users@glassfish.java.net

Re: Sending JMS to a Remote GlassFish Server problems

From: <glassfish_at_javadesktop.org>
Date: Fri, 16 May 2008 03:18:01 PDT

I have the same problem. I try to access to a connection factory located in a remote host but it always tries to get it from localhost. I have the following set in the jvm options:

-Djava.naming.provider.url=iiop://<remoteIP>:3700 -Djava.naming.factory.initial=com.sun.appserv.naming.S1ASCtxFactory -Dorg.omg.CORBA.ORBInitialHost=<remoteIP> -Dorg.omg.CORBA.ORBInitialPort=3700

In the code I have this:

Hashtable env = new Hashtable();
                env.put(Context.PROVIDER_URL, "iiop://<remoteIP>:3700");
                env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.appserv.naming.S1ASCtxFactory");
                env.put("org.omg.CORBA.ORBInitialHost", "<remoteIP>");
                env.put("org.omg.CORBA.ORBInitialPort", "3700");
                
                System.setProperty("org.omg.CORBA.ORBInitialHost", "<remoteIP>");
                System.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
                
                Context ic = new InitialContext(env);

And even with all of that, I get this stack trace:

ADVERTENCIA: NAM1001: No Endpoints selected in com.sun.appserv.iiop.endpoints property. Using JNDI Provider URL iiop://<remoteIP>:3700 instead
16-may-2008 11:46:06 com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
ADVERTENCIA: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 127.0.0.1; port: 3700"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
        at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)

It first uses the remote server but then fails because it tries to access to localhost. Why? How can I send or receive JMS messages from a remote server?
[Message sent by forum member 'getaceres' (getaceres)]

http://forums.java.net/jive/thread.jspa?messageID=274806