RFC Sender: Connection refused

Hi experts,
We are running a scenario with a RFC Sender communication channel.
When the RFC is executed this error occurs in the Runtime Workbench:
Transmitting the message using connection HOSTNAME failed, due to: com.sap.aii.af.ra.ms.api.DeliveryException: java.net.ConnectException: Connection refused: connect
Our basis reported that the HOSTNAME value is incorrect, but could not tell where this information is configurated.
Can anybody tell where is this hostname configurated?
Is there any transaction to check the error?
Thanks anyway.

David,
http://SERVER:8002/sap/xi/engine?type=entry is your integration pipeline URL which belongs to your XI box.
In trasaction SXMB_ADM there are two ways through which you can enter the pipeline URL for the corresponding IE of XI system.
1) By creating and RFC destination and referring that in field "Corresponding Integ. Server" and
2) By directlyspecifying the pipeline URL in above mentioned field
in your case the URL is entered using 2nd option that can be edited by an option Edit-> Change Global parameters.
it will allow you to change the server name.
Thanks,
Sunil Singh

Similar Messages

  • RFC sender connect to PI results in ST22 error - CALL_FUNCTION_NOT_FOUND

    Hello,
    we are doing an RFC connect with a self defined RFC (simply a trigger, a report that calls a FM with a single value) to
    PI.
    The connectivity is working, sender channel in comm.channel monitoring is in green.
    The function module is imported to PI  and implemented in the related scenario.
    But when we try to start the call to PI this will simply result in an ST22 error on PI with the message
    CALL_FUNCTION_NOT_FOUND.
    Does anybody here have an idea about that issue?
    We are on SAP PI 7.0 SP 15.
    Regards
    Dirk

    > Out implementation:
    > We have a TCP IP connection in SM59 of the R/3 with host and service entries for the R/3 system and the registered server prg. name that is the same as in the comm.channel (know about case sensivity).
    > The prog. is registered in SMGW on the R/3 now.
    This looks perfect!
    > In the report where we are calling the function module the destination is the PI connection added as a ABAP Type 3 connection in SM59 of the R/3 system.
    Suppose you created TCP IP connection with a name R3_TO_XI, then in the report you have to code it as shown below.
    CALL FUNCTION 'your RFC FM name here'
      IN BACKGROUND TASK
      DESTINATION 'R3_TO_XI'
      TABLES
    COMMIT WORK.
    Update:-
    You can also refer this wiki..
    https://wiki.sdn.sap.com/wiki/display/XI/RFCtoFILE
    Regards,
    Sarvesh
    Edited by: Sarvesh Singh on Mar 11, 2010 5:04 PM

  • Java.lang.Exception: IOException in sending Request :: Connection refused:

    Hi all,
    I am a new to Oracle 10g.I am using Enterprise manager for DBA jobs.After ogging in to enterprise manager, when i click the refresh button, i get the folllowing error
    " java.lang.Exception: IOException in sending Request :: Connection refused: connect"
    Please do help to slove this problem.
    Thanks

    I'm having the same error in my console header. Here is the content of the emagent.trc file.
    Running 10gR2 on Win 2K3 server. (bold added for readability)
    emctl status dbconsole responds with 'EM Daemon is not running'
    2007-03-29 14:02:23 Thread-1776 ERROR pingManager: nmepm_pingReposURL: Did not receive a response header from repository
    2007-03-29 14:02:23 Thread-1776 WARN main: clear collection state due to OMS_version difference
    2007-03-29 14:02:23 Thread-1776 WARN command: Job Subsystem Timeout set at 600 seconds
    2007-03-29 14:02:24 Thread-1776 WARN upload: Upload manager has no Failure script: disabled
    2007-03-29 14:02:24 Thread-1776 WARN upload: Recovering left over xml files in upload directory
    2007-03-29 14:02:24 Thread-2920 ERROR command: nmejcn: received no status header from repository at http://dB_Domain:5500/em/upload/
    2007-03-29 14:02:24 Thread-1776 WARN upload: Recovered 0 left over xml files in upload directory
    2007-03-29 14:02:25 Thread-1776 WARN metadata: Metric collectSnapshot does not have any data columns
    2007-03-29 14:02:27 Thread-1776 WARN metadata: Metric Disk_Path does not have any data columns
    2007-03-29 14:02:27 Thread-1776 WARN metadata: Metric osm_diskGroupPolicies does not have any data columns
    2007-03-29 14:02:53 Thread-1776 WARN TargetManager: Regenerating all Metadata
    2007-03-29 14:05:17 Thread-1776 ERROR util.files: ERROR: nmeufis_new: failed in lfiopn on file: E:\oracle\product\10.2.0\db_3\dB_Domain_SIGD\sysman\emd\agntstmp.txt. error = 2 (No such file or directory)
    2007-03-29 14:05:28 Thread-1776 ERROR collector: nmecs_validateStateFile(): state file invalid : E:\oracle\product\10.2.0\db_3\dB_Domain_SIGD\sysman\emd\state\snapshot
    2007-03-29 14:05:28 Thread-1776 ERROR collector: Collector state files cleaned, severity will be resent
    2007-03-29 14:05:35 Thread-3660 ERROR upload: Error in uploadXMLFiles. Trying again in 60.00 seconds.
    2007-03-29 14:05:48 Thread-676 ERROR upload: Failed to delete/move xml file C:\WINDOWS\TEMP\X11.uod, ret = -2 ; agent exiting
    2007-03-29 14:05:48 Thread-676 ERROR : Signalled to Exit with status 3
    2007-03-29 14:05:48 Thread-1776 ERROR main: EMAgent abnormal terminating
    2007-03-29 14:06:29 Thread-2996 WARN command: Job Subsystem Timeout set at 600 seconds
    2007-03-29 14:06:29 Thread-2996 WARN upload: Upload manager has no Failure script: disabled
    2007-03-29 14:06:29 Thread-2996 WARN upload: Recovering left over xml files in upload directory
    2007-03-29 14:06:29 Thread-2996 WARN upload: Recovered 5 left over xml files in upload directory
    2007-03-29 14:06:29 Thread-2996 WARN upload: Merging leftover data file named errors.dat
    2007-03-29 14:06:29 Thread-2996 WARN upload: Merging leftover data file named severity.dat
    2007-03-29 14:06:30 Thread-2996 WARN upload: Merging leftover data file named rawdata.dat
    2007-03-29 14:06:30 Thread-2996 WARN metadata: Metric collectSnapshot does not have any data columns
    2007-03-29 14:06:31 Thread-2996 WARN metadata: Metric Disk_Path does not have any data columns
    2007-03-29 14:06:31 Thread-2996 WARN metadata: Metric osm_diskGroupPolicies does not have any data columns
    2007-03-29 14:07:29 Thread-2328 ERROR util.files: nmeufile_getLength: Error in lfilen. Error = 2 (No such file or directory)
    2007-03-29 14:15:19 Thread-1960 WARN http: 268,-1: nmehl_httpListener: signaled to exit from emctl
    Thank you for your help!
    Message was edited by:
    david.d

  • Java.lang.Exception: IOException is sending Request :: Connection refused

    Hi, everybody.
    Oracle Database Control 10g displays on the home page the following message
    -- java.lang.Exception: IOException is sending Request :: Connection refused
    after killing some database lock that is impeding the users to successfully carry out their daily activities.
    What could be the reason ?

    agent come with db was not working on that time

  • How to send a file without getting Connection Refused??

    Hello everyone!
    I'm developing a FTP (Client and Server) program as a project and I have 2 main problems:
    1. The program can't connect to computers with router (Connection Refused error)
    2. If a computer with router connects to me, the program will not transfer the file (Connection Refused error again). but if it does, my friend's internet is suddenly disconnect after one transfer
    what should i do?!? : //
    everything is working well on one computer, but when i'm trying to work on 2 computers its screwed
    ***FOR EVERY TRANSFER I OPEN A DIFFERENT SOCKET AND CLOSE IT (AND ALL THE OTHER STREAMS) IN CASE OF EXCEPTION OR COMPLETION
    Thanks!!

    cotton.m wrote:
    Oron wrote:
    lol
    sorry..just want you to notice
    so how the other ftp programs transfer files? : //
    i have a test up against 2 testers and my program will not transfer files between 2 computers : ///Are these two computers on the same network? Aka behind the same router? If so then there is another problem, which is either a bug in your program and/or a firewall on one or both of the computers.
    How does FTP work normally? Well in most cases you are talking to a server that is on the internet. This server has been configured to be behind or on a network where the routers are not blocking requests to connect to FTP ports (among other services). So nothing different other than it is configured correctly.
    I do suspect your program may have some bugs as well. For example when you talk about it dropping the connection after one transfer. That doesn't sound too great.when i checked the program...no
    in the test...yes
    so the server has no blocking ports, but what about a client with a router?..how do the programs pass the client blocking?
    when i checked the program with a friend (i have a modem and i was the server) all the data was perfectly transfered (moving among folders, deleting files, creation of folders-->all these actions on the server..sending codes, strings and stuff), but when i tried to transfer a file it did connection refused :S
    i can bring a link to the file that do the transfer and if you have patience to read

  • OEM IOException in sending Request :: Connection refused

    Hi,
    When I want to connect to OEM, I recieve an "java.lang.Exception: IOException in sending Request :: Connection refused".
    In emdb.nohup there is "----- Fri Apr 25 12:11:57 2008::The agentTZRegion value in /oracle/10.2.0/SUNAPART_ARTED08/sysman/config/emd.properties is not in agreement with what agent thinks it should be.Please verify your environment to make sure that TZ setting has not changed since the last start of the agent.
    If you modified the timezone setting in the environment, please stop the agent and exectute 'emctl resetTZ agent' and also execute the script 'mgmt_target.set_agent_tzrgn' to get the value propagated to repository -----"
    But when I want to stop or start or resetTZ anget It xon't work.
    emctl stop agent -->
    Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
    Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
    Killed
    Agent is not running.
    Ok agent is not running, but when I do
    emctl resetTZ agent -->
    Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
    Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved
    Killed
    Agent is running. Stop the agent and rerun the command.
    ???? why ????
    I wonder what the Killed is ?
    It appears allready when I do emctl start dbconsole -->
    Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
    Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
    http://SUNAPART:1158/em/console/aboutApplication
    Killed
    Starting Oracle Enterprise Manager 10g Database Control ....Killed
    started.
    Logs are generated in directory /oracle/10.2.0/SUNAPART_ARTED08/sysman/log
    and emctl stop dbconsole -->
    Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
    Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
    http://SUNAPART:1158/em/console/aboutApplication
    Stopping Oracle Enterprise Manager 10g Database Control ...
    ... Killed
    Failed.
    but the dbconsole isn't longer availlable so it has work.
    Wan you help me solve my problem tks.

    The dbconsole is stopped, (I'va killed it, because stop doesn't work)
    When I do ps -ef | grep dbconsole I have nothing. (the same with agent) but I still have the message "Agent is running" when i want to resetTZ agent.
    In emoms.log, I've
    2008-04-25 13:59:50,178 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.ias.ias.IASIntegration
    2008-04-25 13:59:50,583 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.eml.target.slb.common.SLBIntegration
    2008-04-25 13:59:50,720 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.eml.ssl.intg.SSLIntegration
    2008-04-25 13:59:50,871 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.tip.oem.central.domain.ProcessConnectDomainIntg
    2008-04-25 13:59:50,875 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.tip.oem.central.instance.ProcessConnectInstanceIntg
    2008-04-25 13:59:50,877 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.webdb.admin.em.PortalIntegration
    2008-04-25 13:59:50,880 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.webdb.admin.em.SSOIntegration
    2008-04-25 13:59:50,887 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.reports.em.RepIntg
    2008-04-25 13:59:50,890 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.ocs.mntr.target.OcsEmailIntegration
    2008-04-25 13:59:50,893 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.ocs.mntr.target.OcsOidIntegration
    2008-04-25 13:59:50,896 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.ocs.mntr.target.OcsOvfIntegration
    2008-04-25 13:59:50,898 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.ocs.mntr.target.OcsWebconfIntegration
    2008-04-25 13:59:50,901 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.ocs.mntr.target.OcsWirelessIntg
    2008-04-25 13:59:50,904 [Orion Launcher] ERROR app.ContextInitializer contextInitialized.271 - Integration Class not found: oracle.sysman.ocs.mntr.target.OcsCalGrpIntegration

  • Agent Error? IOException in sending Request :: Connection refused: connect

    For the past couple of days, I have been running into the "IOException in sending Request :: Connection refused: connect" error. I am running 10.2.01 on Windows 2003R2.
    Along with this error, the DB Control shows agent unreachable.
    Is there anything that anyone knows that may have caused this issue?
    Thank You in advance,
    Jeff

    Jhep,
    Have you changed the timezone settings on the database server? Check emdctl.trc and see what it says. In the meanwhile, (a) stop dbconsole service, (b) execute emctl resetTZ agent and (c) restart dbconsole service.
    Kindly should refer to the following Metalink Notes for a possible workaround:
    bq. Metalink Note ID: 362888.1 "Startup Agent: EM Agent will not start due to Timezone mismatch (Daylight \\ Savings changes for Australia)" \\ Metalink Note ID: 409121.1 "Startup Agent: Agent Fails to Start due to Incorrect Timezone File Used as \\ Pointed by ORA_TZFILE" \\ Metalink Note ID: 388280.1 "Startup Agent: ORA-20233: Invalid agent name when running \\ mgmt_target.set_agent_tzrgn procedure in repository"
    Lastly, see if any of the following post(s) are of any assistance to you:
    bq. Oracle 10g EM DB console Host Preferred Credentials for Windows \\ Oracle 10g EM DB console Host Preferred Credentials for Windows \\ New Error -- Since DST 2007 \\ New Error -- Since DST 2007 \\ DST Patching for Grid Control Release 2 \\ Re: DST Patching for Grid Control Release 2
    Hope this resolves the issue.
    Regards,
    Naveed.

  • I am set up mac mini and when I test the mail server by sending a mail from administrator to administrator I get the error message 'Diagnostic-Code: X-Postfix; connect to 127.0.0.1[127.0.0.1]:10024: Connection    refused'. Can any one suggest a solution

    I set up mac mini and when I test the mail server by sending a mail from administrator to administrator I get the error message 'Diagnostic-Code: X-Postfix; connect to 127.0.0.1[127.0.0.1]:10024: Connection    refused'. Can any one suggest a solution

    Thanks. Where could I possibly look for a firewall rule. I knowingly did not creat any. My system has internet coming to a Modem which then is connected to a wireless router. I have computers connecting to the router through cable as well as wireless. One of these computers has been our  mailserver using Mercury and Pegasus and that computer has a static IP address. The Mac Mini also has been assigned a different srtatic IP address. I have only set up user account, none of them an email account as I initially expect them to receive only internal mails. Is it necessary that I must set up an email id for each user while setting up the user account. My server id is server.local. So would the email id for local users be [email protected]?

  • IOException in sending Request :: Connection refused: connect

    I am using Oracle 10g release 2 windows XP Professional.
    I am trying to shutdwon/startup my database thru Enterprise Management Console. However I get the error message:
    IOException in sending Request :: Connection refused: connect
    The following error message is in the emdctl.trc
    (error = 10061)
    2007-10-30 21:43:45 Thread-2500 WARN http: snmehl_connect: connect failed to (peaches.austin.rr.com:1158): No connection could be made because the target machine actively refused it.
    (error = 10061)
    2007-10-30 21:44:20 Thread-3392 WARN http: snmehl_connect: connect failed to (peaches.austin.rr.com:3938): No connection could be made because the target machine actively refused it.
    (error = 10061)
    2007-10-30 21:45:17 Thread-572 ERROR main: nmectl.c: nmectl_validateTZRegion, agentTZoffset =-300,and testTZoffset for America/Chicago:-360 do not match
    2007-10-30 21:45:18 Thread-572 ERROR main: nmectl.c: nmectl_validateTZRegion, agentTZoffset =-300,and testTZoffset for America/Chicago:-360 do not match
    Can you help me with this problem. Thanks!

    REM Set environment variables ORACLE_HOME and ORACLE_SID in Windows System properties.
    REM Open a Command Prompt window. Enter:
    emctl stop agent
    REM Identify an entry from supportedtzs.lst with an offset that matches the one in emdctl.trc
    REM Edit emd.properties file replacing the agentTZRegion value with the one found in supportedtzs.lst.
    REM For me this meant replacing agentTZRegion=American/Chicago with agentTZRegion=EST5EDT for a -300 offset
    REM From Windows Services control panel, restart OracleDBConsoleorcl.
    emctl start agent

  • Cant send emails nskntcmgw05p BigPond Outbound Connection refused. OB113.

    i can receive emails ,but cant send them ,get error message
    An error occurred sending mail: The mail server sent an incorrect greeting: nschwcmgw08p BigPond Outbound Connection refused. OB113.

    bigpond suffer rather badly from incompetence and a disconnect between their technical people and the idiots on support.
    If it works sometime and not others you can be almost certain that the good people at Bigpond have managed to mess it up again, unfortunately the IQ of their tech support people is so low that a conversation is about impossible, let along an actual useful solution. Last time I wasted time with them they blamed my copy of Microsoft Outlook and regardless of my assurances that it was simply not installed, refused to change their tack, or put me onto someone with a sufficient grasp on reality to at least consider blaming installed software.
    My solution, and that of many others, is to simply not use their email accounts for communication with anyone but bogpond. If I had a choice, I would not be their customer at all, but where I live real choice is not something we have.

  • Hi, I am new to Mac and i managed to install and configure all the services. Now my issue is when i sending mail using the local server to internal, mail are not receiving. Mail queue showing Connection refused error. Please help me

    I am new to Mac and i managed to install and configure all the services. Now my issue is when i sending mail using the local server to internal, mails are not receiving. Mail queue showing Connection refused error. Please help me
    Thanks
    GIRI

    Try this -> http://support.apple.com/kb/TA38632?viewlocale=en_US

  • Communication Channel RFC Sender getting error suddenly

    Hello gurus,
    I'd like to ask you about a problem, we have many interfaces from RFC to SOAP synchronous, the CC RFC sender, in an average of once per day, gets into red colour with this error:
    Sender channel 'CC_RFC_SENDER_L0_MAESTROS' for party '', service 'BS_LD0_100'
    Error can not instantiate RfcPool caused by:
    com.sap.aii.adapter.rfc.RfcAdapterException: error
    initializing RfcServerPool:com.sap.aii.adapter.rfc.core.repository.RfcRepositoryException:
    can not connect to destination system due to: com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION:
    Connect to SAP gateway failed
    Connect_PM TYPE=A ASHOST=10.1.4.191 SYSNR=00 GWHOST=10.1.4.191 GWSERV=sapgw00 PCS=1
    LOCATION CPIC (TCP/IP) on local host with Unicode
    ERROR partner 'XX.X.X.XXX:sapgw00' not reached
    TIME Thu May 27 03:56:04 201
    RELEASE 711
    COMPONENT NI (network interface)
    VERSION 39
    RC -10
    MODULE nixxi.cpp
    LINE 3151
    DETAIL NiPConnect2: 10.1.4.191:3300
    SYSTEM CALL connect
    ERRNO 111
    ERRNO TEXT Connection refused
    COUNTER 5
    I don't know the reason of this.. but simply just stopping and starting the CC it gets into green colour again..
    Does anyone know how to solve this?
    Regards,
    Juan.

    Hi,
    This happens if the RFC connection pool is not instantiated or may be cache failed to auto-refresh....And manual restart of RFC channel resolves it.
    Refer page 8 in the RFC troubleshooting guide.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f3f93ee7-0c01-0010-2593-d7c28b5377c2?quicklink=index&overridelayout=true
    Thanks
    Swarup

  • R3 (rfc-sender) - XI - Webservice ( soap-receiver)

    Hi,
    I am getting below error whenever webservice(target system) is unavailable.
    HTTP 404 Not Found
    Then RFC got failed in R3, due to this error in XI
    R3 (rfc-sender) <-> XI <-> Webservice ( soap-receiver) Synch
    User will enter the request data in R3 and waiting for the response, but webservice is down(i.e not available)
    Request is reached to XI box and XI is trying to send data when webservice is down( i,e not available), RFC is waiting for the response from XI box.
    how we will handle this kind of situation,how should i give response back to RFC( because RFC sent the request and waiting for the response, XI could not send any response back as Webservce is down, Please advice me how should XI inform to the end user r R3 abt webservice.
    I am getting this error to my mail box as i have configured ALERTS. i do not want to change existing RFC.
    is there any chance to send response to R3 even webservice is down, please can any one suggest.
    Thanks,
    SIva
    Edited by: Siva Grandhi on Jun 18, 2008 1:12 PM

    Hi siva,
    check this blog on HTTP errors.
    /people/krishna.moorthyp/blog/2006/07/23/http-errors-in-xi
    May be the URL you have given in SOAP at receiver adapter is wrong.Check that once.
    Error: 404 Not Found
    Description: The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.
    Possible Tips:- for HTTP_RESP_STATUS_CODE_NOT_OK 404
    u2022 404 is an HTTP response code that indicates that the resource in question couldn't be found. Usually this is due to an incorrect URL, so it is better to cross check all URLs. Check pipeline URL in the SLD in the business system of the Integration Server For this go to SLD->Business System-><yourIntegrtaion Server>->Pipeline URL: It should be like this http://<host>:<port>/sap/xi/engine?type=entry Where host is the host name of the Integration Server and port is the HTTP(8xxx) port. To verify this in Integration Server you can do like this. Go to SXMB_ADM->Integration Engine Configuration->Choose Edit from Menu -> Change Global Configuration Data to switch to change mode. Then select System Landscape - Load Configuration. (This is not required always)
    u2022 Check that the port really is the ICM HTTP Port and not the J2EE port i.e SMICM then menu GOTO --> SERVICES and check the port number for HTTP. It should be HTTP port
    u2022 If the error is Page cannot be displayed, cannot find server in https configurations Check and correct the SSL configuration for the ABAP and the J2EE side of the system
    u2022 If the error is because of integration server when using Proxy communications then check these. i.e SXMB_ADM->Integration Engine Configuration->Corresponding Integration Server enrty should be dest://<Http Integration server-Destination> Where < Http Integration server -Destination > is the RFC destination (SM59) of type HTTP connection (type H) to the Integration Server. In this case, host name, port, and path prefix are saved in the RFC destination.
    Thanks,
    Vijaya.

  • GetOutputStream()  -- Connection refused: connect

    Hi, i'm doing this (inside a function)
    URL receiver = new URL(url);
    HttpURLConnection receiverConnection  = (HttpURLConnection)(receiver.openConnection());
                receiverConnection.setDoInput(true);
                receiverConnection.setDoOutput(true);
                receiverConnection.setRequestProperty( "Authorization", "Basic " + encodedPassword);
                receiverConnection.setRequestProperty( "Content-type", "application/x-sap.rfc");
                System.setProperty("javax.xml.transform.TransformerFactory", "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl");
                TransformerFactory tFactory = TransformerFactory.newInstance();
                Transformer transformer = tFactory.newTransformer();
                Reader rd = new StringReader(strXml);
                StreamSource streamSource = new StreamSource(rd);
                PrintWriter pw = new PrintWriter(receiverConnection.getOutputStream(), false);
                StreamResult streamResult = new StreamResult(pw);
                transformer.transform(streamSource, streamResult);
                pw.flush();
                pw.close();and when i do the receiverConnection.getOutputStream() it throws
    "Connection refused: connect"... i'm using JDK 1.5 with tomcat 5.0...
    thanks in advanced!!!

    Comment out your call to setDoInput(true). See if that helps. If not, then it is probably a configuration issue on the server you are attempting to send to.
    - Saish

  • Connection refused when trying to getOutputStream from https connection

    Hi all !
    I want to make an https connection with a server to send/get the request/response
    What can be the cause of the following error in the following code testHttps.java?
    java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
    at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(Unknown Source)
    at sun.net.NetworkClient.doConnect(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
    at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
    at Test.testHttps.main(testHttps.java:46)
    Exception in thread "main" java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
    at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(Unknown Source)
    at sun.net.NetworkClient.doConnect(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
    at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
    at Test.testHttps.main(testHttps.java:51)
    testHttps.java
    package Test;
    import java.io.;
    import java.net.;
    import javax.net.ssl.*;
    public class testHttps {
    public static void main(String args[]) throws Exception {
    //System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
    // Create a trust manager that does not validate certificate chains
    TrustManager[] trustAllCerts = new TrustManager[]{
    new X509TrustManager() {
    public java.security.cert.X509Certificate[] getAcceptedIssuers() {
    return null;
    public void checkClientTrusted(
    java.security.cert.X509Certificate[] certs, String authType) {
    public void checkServerTrusted(
    java.security.cert.X509Certificate[] certs, String authType) {
    // Install the all-trusting trust manager
    try {
    SSLContext sc = SSLContext.getInstance("SSL");
    sc.init(null, trustAllCerts, new java.security.SecureRandom());
    HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
    } catch (Exception e) {
    System.out.println("Error" e);
    // Now you can access an https URL without having the certificate in the truststore
    try {
    URL url = new URL("https://..............");-->//address of the server given here
    URLConnection conn = url.openConnection();
    HttpsURLConnection urlConn = (HttpsURLConnection) conn;
    urlConn.setDoOutput(true);
    OutputStreamWriter wr = null;
    try{
    wr = new OutputStreamWriter(conn.getOutputStream());
    catch(Exception e){
    e.printStackTrace();
    BufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
    String str;
    while( (str=in.readLine()) != null) {
    System.out.println(str);
    } catch (MalformedURLException e) {
    System.out.println("Error in SLL Connetion" +e);
    HostnameVerifier hv = new HostnameVerifier()
    public boolean verify(String urlHostName, SSLSession session)
    System.out.println("Warning: URL Host: " urlHostName " vs. "
    session.getPeerHost());
    return true;
    want to ignore certificate validation.
    plese help me..
    hi brucechapman, as you suggested me, i posted in Core API- networking forum, now please gimme a solution
    Thanks in advance.

    hi brucechapman,
    ran the NetTest program, got the following exception:
    trigger seeding of SecureRandom
    done seeding SecureRandom
    Exception in thread "main" java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.SocksSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
         at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(Unknown Source)
         at sun.net.NetworkClient.doConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
         at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
         at java.net.URL.openStream(Unknown Source)
         at Test.NetTest.main(NetTest.java:40)
    NetTest.java:40 -- InputStream is = url.openStream(); at this ling throwing exception.
    For the following program, i have added the argument -Djavax.net.ssl.trustStore=cacerts
    i have exported the certificate from IE and added to the keystore.
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.security.Security;
    import javax.net.ssl.SSLSocket;
    import javax.net.ssl.SSLSocketFactory;
    public class Communicator {
    public static void main(String[] args) {
    try {
    int port = 34443;
         String strReq = "xml content ";
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault();
    SSLSocket socket = (SSLSocket) factory.createSocket("jyoti-win2k8-32", port);
    //Writer out = new OutputStreamWriter(socket.getOutputStream());
    //out.write("GET http://" + "hostname" + "/ HTTP 1.1\r\n");
    // out.write("\r\n");
    //out.write(strReq);
    //out.flush();
    OutputStreamWriter wr = null;
    try{
         wr = new OutputStreamWriter(socket.getOutputStream());
         catch(Exception e){
              e.printStackTrace();
         System.out.println("got output stream");
         try{
         wr.write(strReq);
         //System.out.println("response code : "+conn.getResponseCode());
         System.out.println("written");
         wr.flush();
         catch(IOException e){
              e.printStackTrace();
    InputStreamReader is = new InputStreamReader(socket.getInputStream(),"UTF8") ;
         BufferedReader rd = new BufferedReader(is);
         String line;int count=0;
         System.out.println("rd "+rd);
         while ((line = rd.readLine()) != null) {
              System.out.println("line "+line );
              System.out.println(count++);
              // Process line...
         System.out.println(count);
    rd.close();
    BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    int c;
    while ((c = in.read()) != -1) {
    System.out.write(c);
    //out.close();
    in.close();
    socket.close();
    } catch(IOException ex) {
    ex.printStackTrace();
    Exception :
    javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
         at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(Unknown Source)
         at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
         at sun.nio.cs.StreamEncoder.writeBytes(Unknown Source)
         at sun.nio.cs.StreamEncoder.implFlushBuffer(Unknown Source)
         at sun.nio.cs.StreamEncoder.implFlush(Unknown Source)
         at sun.nio.cs.StreamEncoder.flush(Unknown Source)
         at java.io.OutputStreamWriter.flush(Unknown Source)
         at Test.Communicator.main(Communicator.java:55)
    Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
         at sun.security.validator.PKIXValidator.<init>(Unknown Source)
         at sun.security.validator.Validator.getInstance(Unknown Source)
         at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.getValidator(Unknown Source)
         at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
         at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
         at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown Source)
         at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
         at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
         at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown Source)
         ... 7 more
    Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
         at java.security.cert.PKIXParameters.setTrustAnchors(Unknown Source)
         at java.security.cert.PKIXParameters.<init>(Unknown Source)
         at java.security.cert.PKIXBuilderParameters.<init>(Unknown Source)
         ... 19 more
    java.net.SocketException: Socket is closed
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.getInputStream(Unknown Source)
         at Test.Communicator.main(Communicator.java:66)
    please help me and provide me suggestion/solution. how to get rid off this trustanchor paramater exception
    what is it actualy?
    Thanks in advance.

Maybe you are looking for