Hi!
I just switched from the SUN J2EE server to jBoss, becaus I had a lot of
trouble with J2EE. I hope, I'll get some more help here :-)

My problem:

The following code works well, when the client is executed on the same
machine on which the server resides:

Hashtable env = null;
env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL,"server.company.com");
env.put("java.naming.factory.url.pkgs","org.jboss.naming");
Context initial = new InitialContext(env);
java.lang.Object objref = initial.lookup("TestBean");
EJBTestHome home = (EJBTestHome) PortableRemoteObject.narrow(objref,
EJBTestHome.class);
...

If I run this code on a remote machine I get:

javax.naming.CommunicationException.  Root exception is
java.rmi.ConnectException: Connection refused to host: localhost; nested
exception is:
        java.net.ConnectException: Connection refused: no further
information
java.net.ConnectException: Connection refused: no further information
        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.Socket.<init>(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown
Source)
        at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown
Source)
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown
Source)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown
Source)
        at sun.rmi.server.UnicastRef.invoke(Unknown Source)
        at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
        at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:280)
        at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:265)
        at javax.naming.InitialContext.lookup(Unknown Source)
        at TestClient.main(TestClient.java:30)

What am I doing wrong ? I also tried to set the
org.omg.CORBA.ORBInitialHost property, no effect. I just don't
understand, why the client still tries to connect to the localhost, as
the exception message states.

Please help me ! I am really tiered of setting servers up :-/ ...

Ciao,
Tobias


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to