Rmi client throws Connection Refused exception

My Rmi client throws a Connection Refused exception when i try to run it on remote machine (in this case i run it on my virtualbox macine).
The virtualbox machine network is in NAT mode (host machine ip should be 10.0.2.2).
When rmi client starts get registry instance and print in standar output:
RegistryImpl_Stub[UnicastRef2 [liveRef: [endpoint:[//10.0.2.2/:1099,util,RmiInstances$1@1275d39](remote),objId:[0:0:0, 0]]]]But when rmi client trys to use any of remote methods it throws Connection Refused, but it's to strange because the Connection Refused has 127.0.1.1 as ip.
java.rmi.ConnectException: Connection refused to host: 127.0.1.1; ....In client RmiInstances code (this class contains all remote implementations) is:
public class RmiInstances {
    private static RmiInstances instance;
    private IUserManage userManage;
    private IAnalysis analysis;
    private IPacientManage pacientManage;
    private IInsuranceManage insuranceManage;
    private Config config;
    private RmiInstances()
            throws RemoteException, NotBoundException, IOException {
        this.config = Config.getInstance();
        Registry registry = LocateRegistry.getRegistry(config.getServerUrl()+"/",
                1099, new RMIClientSocketFactory() {
            @Override
            public Socket createSocket(String host, int port) throws IOException {
                try {
                    URI uri = new URI(config.getServerUrl()+
                            ":"+config.getServerPort());
                    return new Socket(uri.getHost(), uri.getPort());
                } catch (URISyntaxException ex) {
                    ex.printStackTrace();
                    return null;
        System.out.println(registry);
        userManage = (IUserManage)registry.lookup("RUserManage");
        analysis = (IAnalysis)registry.lookup("RAnalysis");
        pacientManage = (IPacientManage)registry.lookup("RPacientManage");
        insuranceManage = (IInsuranceManage)registry.lookup("RInsuranceManage");
...And server code is the next:
public static void main(String[] args) {
     System.out.println("GNULab Server " + VERSION + " starting...");
     System.setProperty("java.rmi.server.codebase",
          "file:/home/zarovich/workspace/labserver/bin");
     try {
         // Loading config
         System.out.println("Loading config...");
         Config config = Config.getInstance();
         // inicializando rmi registry
         Registry registry;
         if (config.isSsl()) {
          registry = LocateRegistry.createRegistry(
               config.getServerPort(), new RmiSSLClient(),
               new RmiSSLServer());
         } else
          registry = LocateRegistry
               .createRegistry(config.getServerPort());
         // instanciando implementaciones
         RAnalysis rAnalysis = new RAnalysis();
         RInsuranceManage rInsuranceManage = new RInsuranceManage();
         RPacientManage rPacientManage = new RPacientManage();
         RUserManage rUserManage = new RUserManage();
         // registrando interfaz rmi
         registry.rebind("RAnalysis", (IAnalysis) UnicastRemoteObject.exportObject(rAnalysis, 0));
         registry.rebind("RInsuranceManage", (IInsuranceManage) UnicastRemoteObject.exportObject(rInsuranceManage, 0));
         registry.rebind("RPacientManage", (IPacientManage) UnicastRemoteObject.exportObject(rPacientManage, 0));
         registry.rebind("RUserManage", (IUserManage) UnicastRemoteObject.exportObject(rUserManage, 0));
         System.out.println("GNULab Server " + VERSION + " listening ...");
         System.out.println("Registry instance: " + registry.toString());
     } catch (RemoteException e) {
         e.printStackTrace();
        * catch (MalformedURLException e) { e.printStackTrace(); }
        */catch (IOException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
     } catch (JDOMException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
...

I'm solved my problem.
I just need run my server with -Djava.rmi.serverhost=10.0.2.2 and my client running on my virtualbox machine works!

Similar Messages

  • Force RMI client to connect to one Port

    Hi,
    Is there a way to force an RMI client to connect to a specific port.
    Any hint will be greatly appreciated
    Wafic

    Not really since it needs 2 ports, one for the RMI registry and other for the remote object.
    You can set these ports to what you like though (not the same).
    First port you set when you create/start your rmiregistry, the second when you create the UnicastRemoteObject, in its constructor you can specify it with the constructor UnicastRemoteObject(int port).
    This is only available since JDK1.2 though. When you connect with the client to the rmiregistry and the remote object, you specify the port in the URL from the client side like:
    rmi://localhost:port/remoteobjectname
    just replace localhost with the address of the server.
    The remote object port is passed to the client by the rmiregistry.

  • Connection Refused Exception.

    Hi! I have made a java server as an NT Service. This server and my client works fine when I run them from command prompt. But when I make the server as an NT service and then try to connect to it using this client, I get an exception saying connection refused. Can anyone help me with this, its urgent.
    thanks
    rahul

    This is the client program
    import java.net.*;
    public class Client {
    public static void main(String[] args)
    try
    Socket mySocket = new Socket("localhost", 4000);
    System.out.println("Connected");
    catch (Exception e)
    System.err.println("Exception: " + e);
    This is the Server Program
    import java.io.*;
    import java.util.Date;
    class MyServer {
    int m_port;
    ServerSocket m_serverSocket;
    public static void main(String[] args)
    new MyServer(4000);
    public MyServer(int port)
    m_port=port;
    try {
    init();
    catch (Exception e)
    System.out.println("Caught : "+e);
    public void init() throws Exception
    m_serverSocket = new ServerSocket(m_port);
    while(true)
    Socket client = m_serverSocket.accept();
    Thread clientThread = new Thread(new ClientHandler(client));
    clientThread.start();
    public void close() throws Exception { m_serverSocket.close(); } }
    and this is the ClientHandler PRogram.
    import java.io.*;
    import java.net.*;
    import java.util.Date;
    class ClientHandler implements Runnable {
    Socket m_socket;
    public ClientHandler(Socket clientSocket) {
    m_socket=clientSocket; }
    public void run() {
    try {
    processRequests();
    m_socket.close();
    catch (Exception e) { System.out.println("Caught "+e); }
    public void processRequests() throws IOException {
    DataOutputStream dout= new DataOutputStream(m_socket.getOutputStream());
    dout.writeChars((new Date()).toString()+"\n"); } }
    ...The point is that they run perfectly on command prompt but not when i make this server as nt service.
    What could go Wrong ??
    thanks
    rahul

  • Erratic connection refused exception

    Hi all,
    I have a thread in my program that periodically tries to do a Naming.lookup to a remote machine, and proceeds to do other things if there is no exception (this may be compared roughly to pinging the remote server to see if it is up and running).
    While this works fine on most occasions, I sometimes get exceptions like:
            Connection refused to host: remotehost; nested exception is:
            java.net.ConnectException: Connection refused: no further informationfor no apparent reason. This persists for a few cycles of the thread, after which, again for no apparent reason, my client is able to do a Naming.lookup as usual.
    I've made sure that the network connection between the two machines is active, and both of them are alive when these exceptions occur, so I'm not able to pin down the problem.
    I'm starting up a rmiregistry instance in the remote server using LocateRegistry.createRegistry(1099), instead of starting the rmiregistry program from the command line. Could this be a cause for problem?
    I'm using Windows 2000 server with jre 1.3.1 on both machines.
    Thanks,
    Sudarshan

    1. Sometimes just putting in a retry works. Set up a loop and do a naming and if a connection error, wait a few seconds and try it again.
    2. Why do you need multiple look-ups? Once your client gets the remote object there is no longer any need for the RMI Registry. Save the remote object and call the Server directly.

  • JAX-WS Client throws NULL Pointer Exception in NW 7.1 SP3 and higher

    All,
    My JAX-WS client is throwing an exception when attempting to create a client to connect to the calculation service. The exception is coming out of the core JAX-WS classes that are part of NetWeaver. (see exception below)
    Caused by: java.lang.NullPointerException
         at com.sap.engine.services.webservices.espbase.client.jaxws.core.SAPServiceDelegate.createDispatchContextExistingPort(SAPServiceDelegate.java:440)
         at com.sap.engine.services.webservices.espbase.client.jaxws.core.SAPServiceDelegate.createDispatchContext(SAPServiceDelegate.java:475)
         at com.sap.engine.services.webservices.espbase.client.jaxws.core.SAPServiceDelegate.createDispatch(SAPServiceDelegate.java:492)
         at com.sap.engine.services.webservices.espbase.client.jaxws.core.SAPServiceDelegate.createDispatch(SAPServiceDelegate.java:484)
         at javax.xml.ws.Service.createDispatch(Service.java:166)
    I have done some research and it appears that as of NetWeaver 7.1 SP3 SAP stopped using the SUN JAX-WS runtime and implemented their own SAP JAX-WS runtime. I also took the time to decompile the jar file that contained the SAPServiceDelegate class which is throwing the null pointer exception. (see method from SAPServiceDelegate below)
        private ClientConfigurationContext createDispatchContextExistingPort(QName portName, JAXBContext jaxbContext)
            BindingData bindingData;
            InterfaceMapping interfaceMap;
            InterfaceData interfaceData;
            bindingData = clientServiceCtx.getServiceData().getBindingData(portName);
            if(bindingData == null)
                throw new WebServiceException((new StringBuilder()).append("Binding data '").append(portName.toString()).append("' is missing!").toString());
            QName bindingQName = new QName(bindingData.getBindingNamespace(), bindingData.getBindingName());
            interfaceMap = getInterfaceMapping(bindingQName, clientServiceCtx);
            interfaceData = getInterfaceData(interfaceMap.getPortType());
            ClientConfigurationContext result = DynamicServiceImpl.createClientConfiguration(bindingData, interfaceData, interfaceMap, null, jaxbContext, getClass().getClassLoader(), clientServiceCtx, new SOAPTransportBinding(), false, 1);
            return result;
            WebserviceClientException x;
            x;
            throw new WebServiceException(x);
    The exception is being throw on the line where the interfaceMap.getPortType() is being passed into the getInterfaceData method. I checked the getInterfaceMapping method which returns the interfaceMap (line above the line throwing the exception). This method returns NULL if an interface cannot be found. (see getInterfaceMapping method  below)
       public static InterfaceMapping getInterfaceMapping(QName bindingQName, ClientServiceContext context)
            InterfaceMapping interfaces[] = context.getMappingRules().getInterface();
            for(int i = 0; i < interfaces.length; i++)
                if(bindingQName.equals(interfaces<i>.getBindingQName()))
                    return interfaces<i>;
            return null;
    What appears to be happening is that the getInterfaceMapping method returns NULL then the next line in the createDispatchContextExistingPort method attempts to call the getPortType() method on a NULL and throws the Null Pointer Exception.
    I have included the code we use to create a client below. It works fine on all the platforms we support with the exception of NetWeaver 7.1 SP3 and higher (I already checked SP5 as well)
          //Create URL for service WSDL
          URL serviceURL = new URL(null, wsEndpointWSDL);
          //create service qname
          QName serviceQName = new QName(targetNamespace, "WSService");
          //create port qname
          QName portQName = new QName(targetNamespace, "WSPortName");
          //create service
          Service service = Service.create(serviceURL, serviceQName);
          //create dispatch on port
          serviceDispatch = service.createDispatch(portQName, Source.class, Service.Mode.PAYLOAD);
    What do I need to change in order to create a JAX-WS dispatch client on top of the SAP JAX-WS runtime?

    Hi Guys,
    I am getting the same error. Any resolution or updates on this.
    Were you able to fix this error.
    Thanks,
    Yomesh

  • Connection refused Exception parsing an xml on a network drive

    I am getting a "java.net.ConnectException: Connection refused: connect" exception when I try to parse an xml file over a network drive with a url like "\\Host\shared\file.xml". The problem only happens if I use a full qualified url to the file, if I map the drive to the local server then it works fine. This means that "\\Host\shared\file.xml" fails while "G:\file.xml" works but the two point to the same file. The other thing is that it fails for JDK 1.4.0 but works file for JDK1.3.1. Same program, same classpath, same server: it works with JDK1.3.1 but throws the exception for JDK1.4.0. Following is the full exception trace:
    java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295)
    at java.net.PlainSocketImpl.connectToAddress PlainSocketImpl.java:161)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
    at java.net.Socket.connect(Socket.java:425)
    at java.net.Socket.connect(Socket.java:375)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.NetworkClient.openServer(NetworkClient.java:118)
    at sun.net.ftp.FtpClient.openServer(FtpClient.java:387)
    at sun.net.ftp.FtpClient.<init>(FtpClient.java:651)
    at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.ja
    va:175)
    at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnec
    tion.java:257)
    at java.net.URL.openStream(URL.java:955)
    at org.apache.xerces.readers.DefaultReaderFactory.createReader(DefaultRe
    aderFactory.java:149)
    at org.apache.xerces.readers.DefaultEntityHandler.startReadingFromDocume
    nt(DefaultEntityHandler.java:491)
    at org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:3
    12)
    at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1080)
    at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1122)

    From the stack trace posted it appears that URL.openStream decided to use FTP to access the file. Of course that won't work. But the key is that a URL is expected, at least that's what I infer from this line:
    at java.net.URL.openStream(URL.java:955)
    And \\Host\shared\file.xml isn't a URL. Looks like 1.4 has fixed something which broke that shortcut. Change it to a real URL, something like
    file:////Host/shared/file.xml
    Four / is probably correct, although you may have to try it with three.

  • Connection Refused Exception (imap protocol configuration in james server)

    hai if i use pop3 protocol i can read the message from the james server
    but if i use imap protocol i'm getting the exception connection refused.
    what shall i do?

    Sounds like a question to ask in the Apache James forum.
    The server doesn't seem to be set up to accept IMAP connections.

  • RMI client losing connection and weblogic.rjvm.PeerGoneException

    What causes PeerGoneExceptions? We are seeing this very often on our
    production and test systems. We use WLS RMI clients connected to WLS 4.5.1
    servers w/ service pack 10. I understand that there is a heartbeat between
    the client JVM and the server JVM. Is there any documentation that explains
    how this actually works. For example, how often does the client send its
    heartbeat. Is it configurable? What could cause it to stop or drop the
    connection. We are using straight T3 (no T3S or HTTP).
    thanks for your help,
    Edwin Marcial
    Intercontinental Exchange

    What causes PeerGoneExceptions? We are seeing this very often on our
    production and test systems. We use WLS RMI clients connected to WLS 4.5.1
    servers w/ service pack 10. I understand that there is a heartbeat between
    the client JVM and the server JVM. Is there any documentation that explains
    how this actually works. For example, how often does the client send its
    heartbeat. Is it configurable? What could cause it to stop or drop the
    connection. We are using straight T3 (no T3S or HTTP).
    thanks for your help,
    Edwin Marcial
    Intercontinental Exchange

  • Using an RMI Client to connect to a Server.

    I am using an RMI Client on my PC (using Eclipse 3.2) to connect to a Server on a Linux System.
    The Server is up and running and from the client side,I am reading all the server configuration into a variable and passing this variable into Naming,lookup.
    String lookUp =     "//" + prop.getProperty("rmi.hostName") +
                          ":" +  prop.getProperty("rmi.appPort") +
                          "/" +  prop.getProperty("rmi.appName);
    System.out.println(lookUp)   // Value://17.10.222.80:40009/RMIAPP
    Application a =  (Application)Naming.lookup(lookUp)     It is unable to connect to the Server.
    Am I missing anything? Have I overlooked any point?
    Thanks

    http://java.sun.com/docs/books/tutorial/rmi/index.html

  • Invocation time Exception (java.rmi.ConnectException: Connection refused to

    Hi folks,
    SERVER = LINUX
    CLIENT = WINDOWS 200
    JAVA VERSION : 1.4.2
    Object obj = Naming.lookup("rmi://x.x.x.x:5578/MyServer");
    System.out.println("Object ="+obj); // Works fine and return stub as shown in o/p
    MyServer_Stub server = (MyServer_Stub)obj;
    server.validate(); // throws following Connection refused exception
    -----OUTPUT-----
    Object =com.MyServer_Stub[RemoteStub [ref: [endpoint:[x.x.x.x:42360](remote),objID:[a981ca:10722cb9411:-8000, 0]]]]
    java.rmi.ConnectException: Connection refused to host: x.x.x.x.x; nested exception is:
         java.net.ConnectException: Connection refused: connect
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
         at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
         at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)[
         at com.MyServer_Stub.validate(Unknown Source)/b]
         at tescasees.testbyexample.rmi.MyServerChangesTestApplication.main
    Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
         at java.net.Socket.connect(Socket.java:452)
         at java.net.Socket.connect(Socket.java:402)
         at java.net.Socket.<init>(Socket.java:309)
         at java.net.Socket.<init>(Socket.java:124)
         at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
         at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
         ... 5 more
    Exception in thread "main"
    [b] Why does java system throws exception at invoke time not connection time at lookup time</b]
    Any suggestion...
    Regards,
    Manoj

    > Are you getting this from a lookup()? If so it means the Registry you are looking for at rmi://x.x.x.x:5578 is not present.
    I am getting it at the time when I invoke the method validate on the object returned from lookup.
    --Manoj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • RMI connection refused

    Hello to all,
    I have created and completed an RMI chat application and tested it on my localhost. It worked all right.
    Now I want to make it live i.e. run it through internet.
    Is it same as running on localhost only we have to change the IP address for locating registry.
    I have done that and uploaded the server file on host, also I have the IP address of that host.
    I have replaces localhost whit the give IP address but connection refused exception is thrown.
    I have located the registry on the server through IP address then when I use
    Registry reg=LocateRegistry("xx.xx.xx.xxx");
    System.out.println("1");
    chatAppIF chatStub=(chatAppIF)Naming.lookup("rmi://xx.xx.xx.xxx:xxxx/service");
    System.out.println("2");
    int i=chatStub.logMeIn(user,pass);
    System.out.println("3");Output screen shows
    1
    2
    Client exception: java.rmi.ConnectException: Connection refused to host: xx.xx.xx.xxx; nested exception is:
            java.net.ConnectException: Connection refused: connectWhile when i use
    Registry reg=LocateRegistry("xx.xx.xx.xxx");
    System.out.println("1");
    chatAppIF stub=(chatAppIF)reg.lookup("service");
    System.out.println("2");
    int i=chatStub.logMeIn(user,pass);
    System.out.println("3");it give output as
    1
    Client exception: java.rmi.ConnectException: Connection refused to host: xx.xx.xx.xxx; nested exception is:
            java.net.ConnectException: Connection refused: connectIs there is difference between naming.lookup() and reg.lookup() method?
    I think Naming.lookup() finds the registry but cannot find the method logMeIn() while reg.lookup() has no success.
    anyway why the connection is refused?

    The argument to Naming.bind()/rebind()/unbind() and Naming.lookup() is a URI of the form rmi://hostname[:port]/path.
    The argument to Registry.bind()/rebind()/unbind() and Registry.lookup() is just the path part.
    The data returned by Naming.list() is an array of URIs.
    The data returned by Registry.list() is an array of paths.
    In other words Naming.list() returns items which can be used as arguments to Naming.lookup(), and Registry.list() returns items which can be used as arguments to Registry.lookup().
    The reason is that when you construct a Registry, via LocateRegistry.getRegistry(), you supply the host and port at that point, so specifying it again in the bind/lookup string would be redundant. There's nothing stopping you doing that but the resulting name won't be compatible with what Naming.bind() would have done.

  • Connection refused is not raising an exception

    Hi, I am having problems getting my code to recognise that a url refuses a connection, eg "http://tigers.com.au".
    Opening the url in a browser correctly shows that a connection is refused.
    However, in Java (1.6_07) code as below, no exception is raised, and the response code is 200 OK.
    Even though no exception is raised, the content that is returned by the InputStream is actually from somewhere else (my local development server), so it seems that the connection is not actually successful.
    The code works fine for other urls that does accept a connection, eg it works fine for "http://www.tigers.com.au".
    Why is my code not raising an exception for cases where the url refuses a connection? Or is there a bug in Java?
    Grateful for any help.
              BufferedReader in = null;
              String s=null;
              HttpURLConnection urlCon = null;
              URL url = null;
              try {
                   url = new URL("http://tigers.com.au");
                   urlCon = (HttpURLConnection) url.openConnection(); 
                   urlCon.connect();
                   System.out.println("urlCon after connect: "+urlCon.getURL());
                         System.out.println("Response code: ["+urlCon.getResponseCode()+"] "+urlCon.getResponseMessage());
                   in = new BufferedReader( new InputStreamReader(urlCon.getInputStream()));
                   while ( (s=in.readLine()) != null) {
                        System.out.println("s: "+s);                    
              catch (Exception e) {
                   System.out.println("Exception: "+e);
              }

    Have found that wildcard addresses matches any address of the local system, and that in IPv4, the wildcard address is 0.0.0.0. Can check for this with InetAddress.isAnyLocalAddress().
    This means that I could potentially handle these cases by adding code to "ping" a host such as "tigers.com.au" using
    InetAddress address = InetAddress.getByName(name);
    if (InetAddress.isAnyLocalAddress() {
    .... do something, eg raise exception
    }But this is not fully satisfactory, as I would rather know that a "connection refused" exception is raised, which is actually the case with "tigers.com.au" (as all the browsers seem able to detect). I am not entirely sure what the relationship is between a site that has "connection refused" and it returning an ip address of 0.0.0.0. I don't think they are synonymous.
    Any thoughts?

  • Connection refused with HTTPS

    Hello,
    We have created a webservice deployed to WebLogic Server 9.2. It requires secure transport using the annotation
    @UserDataConstraint(transport=UserDataConstraint.Transport.CONFIDENTIAL)
    We're able to test this successfully using an XSmiles client browser.
    However, I've written a Java client started with "clientgen" that runs successfully when connecting in nonsecure mode (annotation removed) to a local instance. But when I try to connect to our remote server in secure mode I get "connection refused" (the lengthy call stack is copied below).
    The client code is also copied below (a few strings and IPs were changed). It's able to retrieve the WSDL, but then bombs when calling a port method. This is probably something simple but I've followed tutorials and have not found reference to this particular error on forums or via Google. Any ideas would be appreciated!
    Thanks,
    CJ
    = = = = = = = =
    System.setProperty ("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
    java.security.Security.addProvider (new com.sun.net.ssl.internal.ssl.Provider());
    // must define .trustStoreType, .trustStore, and .trustStorePassword
    System.setProperty("javax.net.ssl.trustStore", "c:\\client-keytool.ts");
    System.setProperty("javax.net.ssl.trustStorePassword", "password");
    System.setProperty("javax.net.ssl.trustStoreType", "JCEKS");
    System.setProperty("weblogic.wsee.client.ssl.stricthostchecking", "false");
    System.out.println ("Connecting to the webservice...");
    PatientRegistrationService service = new PatientRegistrationService_Impl ("https://domain/ws/services/PatientRegistrationPort?WSDL");
    PatientRegistrationPort port = service.getPatientRegistrationPort();
    SecurityQuestionRequestType request = new SecurityQuestionRequestType();
    RequestHeaderType requestHeader = new RequestHeaderType();
    requestHeader.setApplication("x");
    requestHeader.setAppLoginId("x");
    requestHeader.setAppPassword("x");
    request.setRegistrationRequest (requestHeader);
    System.out.println ("Calling getSecurityQuestion method...");
    SecurityQuestionResponseType response = port.getSecurityQuestion (request);
    System.out.println ("...just called getSecurityQuestion.");
    = = = = = = = =
    Connecting to the webservice...
    Calling getSecurityQuestion method...
    Exception in thread "Main Thread" java.rmi.RemoteException: SOAPFaultException - FaultCode [{http://schemas.xmlsoap.org/soap/envelope/}Server] FaultString [Failed to send message using connection:(SoapClientConnection@41626058 <transport=(HTTPSClientTransport@41626055 <url=https://IPADDRESS:9223/domain/ws/PatientRegistrationPort>)>)Connection refused: connect] FaultActor [null] Detail [<detail><bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0"></bea_fault:stacktrace>java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Ljava.net.InetAddress;II)V(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.Socket.connect(Socket.java:507)
         at java.net.Socket.connect(Socket.java:457)
         at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
         at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
         at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
         at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:280)
         at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:337)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:176)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:744)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:162)
         at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:836)
         at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)
         at weblogic.wsee.connection.transport.http.HTTPClientTransport.send(HTTPClientTransport.java:161)
         at weblogic.wsee.connection.soap.SoapConnection.send(SoapConnection.java:54)
         at weblogic.wsee.connection.soap.SoapClientConnection.send(SoapClientConnection.java:89)
         at weblogic.wsee.ws.dispatch.client.ConnectionHandler.handleRequest(ConnectionHandler.java:89)
         at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:127)
         at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:100)
         at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:101)
         at weblogic.wsee.ws.WsStub.invoke(WsStub.java:89)
    </detail>]; nested exception is:
         javax.xml.rpc.soap.SOAPFaultException: Failed to send message using connection:(SoapClientConnection@41626058 <transport=(HTTPSClientTransport@41626055 <url=https://IPADDRESS:9223/domain/ws/PatientRegistrationPort>)>)Connection refused: connect
         at test.wsclient.PatientRegistrationPort_Stub.getSecurityQuestion(PatientRegistrationPort_Stub.java:337)
         at test.client.TestClient4.main(TestClient4.java:80)
    Caused by: javax.xml.rpc.soap.SOAPFaultException: Failed to send message using connection:(SoapClientConnection@41626058 <transport=(HTTPSClientTransport@41626055 <url=https://IPADDRESS:9223/domain/ws/PatientRegistrationPort>)>)Connection refused: connect
         at weblogic.wsee.codec.soap11.SoapCodec.decodeFault(SoapCodec.java:259)
         at weblogic.wsee.ws.dispatch.client.CodecHandler.decodeFault(CodecHandler.java:105)
         at weblogic.wsee.ws.dispatch.client.CodecHandler.decode(CodecHandler.java:90)
         at weblogic.wsee.ws.dispatch.client.CodecHandler.handleFault(CodecHandler.java:78)
         at weblogic.wsee.handler.HandlerIterator.handleFault(HandlerIterator.java:254)
         at weblogic.wsee.handler.HandlerIterator.handleResponse(HandlerIterator.java:224)
         at weblogic.wsee.ws.dispatch.client.ClientDispatcher.handleResponse(ClientDispatcher.java:161)
         at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:116)
         at weblogic.wsee.ws.WsStub.invoke(WsStub.java:89)
         at weblogic.wsee.jaxrpc.StubImpl._invoke(StubImpl.java:335)
         at test.wsclient.PatientRegistrationPort_Stub.getSecurityQuestion(PatientRegistrationPort_Stub.java:332)
         ... 1 more
    Caused by: weblogic.wsee.handler.InvocationException: Failed to send message using connection:(SoapClientConnection@41626058 <transport=(HTTPSClientTransport@41626055 <url=https://IPADDRESS:9223/domain/ws/PatientRegistrationPort>)>)
         at weblogic.wsee.ws.dispatch.client.ConnectionHandler.handleRequest(ConnectionHandler.java:91)
         at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:127)
         at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:100)
         at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:101)
         ... 4 more
    Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Ljava.net.InetAddress;II)V(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.Socket.connect(Socket.java:507)
         at java.net.Socket.connect(Socket.java:457)
         at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
         at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
         at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
         at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:280)
         at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:337)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:176)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:744)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:162)
         at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:836)
         at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)
         at weblogic.wsee.connection.transport.http.HTTPClientTransport.send(HTTPClientTransport.java:161)
         at weblogic.wsee.connection.soap.SoapConnection.send(SoapConnection.java:54)
         at weblogic.wsee.connection.soap.SoapClientConnection.send(SoapClientConnection.java:89)
         at weblogic.wsee.ws.dispatch.client.ConnectionHandler.handleRequest(ConnectionHandler.java:89)
         at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:127)
         at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:100)
         at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:101)
         at weblogic.wsee.ws.WsStub.invoke(WsStub.java:89)

    Never mind, my silly mistake!
    Thanks to http://jordan.fortwayne.com/oracle/oralinux.html
    I realized that I had forgotten to do 'lsnrctl start'
    R. Inamdar (guest) wrote:
    : I downloaded Oracle 805 for Linux. I was able to successfully
    : able to connect to the test database and issue queries with
    : SVRMGRL. However, I get a 'Connection Refused' exception
    : while connecting through the JDBC sample program.
    : How do I enable diagnostics. I tried
    : TRACE_LEVEL_LISTENER = SUPPORT
    : but no trace file was created.
    : What am I doing wrong. Thanks for the help...
    : My evironment is:
    : JDK1.1.7
    : Linux Red Hat 5.2
    : Thin JDBC driver
    : Code fragment:
    : DriverManager.registerDriver(new
    jdbc.driver.OracleDriver());
    : Connection conn =
    : DriverManager.getConnection (
    : "jdbc:oracle:thin:@localhost.localdomain:1521:test",
    : "system",
    : "manager"
    : I tried with "localhost" in place of "localhost.localdomain"
    : without success.
    : Following is my listener.ora
    : # Installation Generated Net8 Configuration
    : # Version Date: Jun-17-97
    : # Filename: Listener.ora
    : LISTENER =
    : (ADDRESS_LIST =
    : (ADDRESS= (PROTOCOL= IPC)(KEY= test))
    : (ADDRESS= (PROTOCOL= IPC)(KEY= PNPKEY))
    : (ADDRESS= (PROTOCOL= TCP)(Host=
    : localhost.localdomain)(Port= 1521))
    : SID_LIST_LISTENER =
    : (SID_LIST =
    : (SID_DESC =
    : (GLOBAL_DBNAME= localhost.localdomain.)
    : (ORACLE_HOME= /usr/local/oracle/805)
    : (SID_NAME = test)
    : (SID_DESC =
    : (SID_NAME = extproc)
    : (ORACLE_HOME = /usr/local/oracle/805)
    : (PROGRAM = extproc)
    : STARTUP_WAIT_TIME_LISTENER = 0
    : CONNECT_TIMEOUT_LISTENER = 10
    : TRACE_LEVEL_LISTENER = OFF
    : # TRACE_LEVEL_LISTENER = SUPPORT
    : # TRACE_FILE_LISTENER = lsnr
    : # TRACE_DIRECTORY_LISTENER=/usr/local/oracle/805/network/trace
    null

  • Send Message from RMI Server to RMI Client

    Hi,
    I want to send message to RMI Client throw RMI server to refresh client's data object as it is database application. I guessed i could implement an interface on client side and i can register my client to the server by sending object to the server. It is not helping it is throwing NULL Pointer exception on server side and it is not refreshing. It seems like it is not passing by reference.
    Can any one please guide me with how to send messages to clinet. What is the best way to do it?
    -A Thakkar.

    You need to elaborate the object model of your client. When you run into this situiation where you might have to sublass two different objects, then you should take a look at breaking the client itself into more than one object.
    Let me put it another way: A JFrame is a GUI object; why would you ever try to callback a GUI object? Can't you create - say - a CallbackHandler, and let it initiate further action in the client?

  • 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

Maybe you are looking for

  • Need Help Connecting Crystal XI to Progress Database

    Post Author: leomclaughlin CA Forum: Data Connectivity and SQL I am new to Crystal Reports and need some help figuring out how to connect to my database. I am using Crystal Reports XI and the database is Progress ver 91 (at least as best I can tell,

  • Embedded fonts not working in Air for ios

    hi am building an ActionScript mobile project 4.6 for ios and want to use embedded fonts for my app. we are using the swf method for embedding the fonts , after loading the xml and even got the embedded resourses from swf , the output is not showing

  • Error when connecting applet to database

    Hi, I'm trying to make an applet that get data from database. I'm using this code to connect to database : try Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/mydatabase","mypasswor

  • Single indd placed inside a master indd issues updating links

    a client sent us 200 single indd files and one master indd file where they placed all 200 indd files into it. We converted their images from RGB to CMYK, so all of the links in the master document are modified.  It will not allow me to update the lin

  • Error message 2

    Because I got an error message: MSVCR80.dll, I tried to uninstall itunes. Couldn't remove Mobile Support for Apple. Tried to reinstall itunes anyway. Now getting Error Message 2, can't install. Been at this all day. Very aggravated. Help?