users@glassfish.java.net

How to create remote JM client for glassfish 3.1.1 ?

From: <forums_at_java.net>
Date: Wed, 29 Feb 2012 08:22:55 -0600 (CST)

I want to create a stand alone JMS client for GF 3.1.1 ,the server is centos
6.1,jdk is 32bit 1.6.31,I create the connect factory JNDI and dest resource 
in the GF administrator workplace.

as the example from web, client use following code to obtain
ConnectionFactory:

            Properties props = new Properties();
            props .setProperty("java.naming.factory.initial",
"com.sun.enterprise.naming.impl.SerialInitContextFactory");
            props .setProperty("java.naming.factory.url.pkgs",
"com.sun.enterprise.naming");
            props .setProperty("java.naming.factory.state",
"com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
            props.setProperty("org.omg.CORBA.ORBInitialHost",
"172.24.9.116");
            // optional.  Defaults to 3700.  Only needed if
target orb port is not 3700.
            props.setProperty("org.omg.CORBA.ORBInitialPort",
"3700");
            InitialContext context = new InitialContext(props);
  
            connectionFactory = (ConnectionFactory)
context.lookup("jms/smsCF");

 

if org.omg.CORBA.ORBInitialHost set to my  local glassfish server,the client
excute fine ,but if I change the host to  remote server,the program always
stop at   :

            connectionFactory = (ConnectionFactory)
context.lookup("jms/smsCF") ,

no error,no response.

Some one said set JVM parameter as -Dorg.omg.CORBA.ORBInitialPort=3700
-Dorg.omg.CORBA.ORBInitialHost="the remote server" or use System property to
set this parameter in the program,but it's no effect.

telnet 192.168.3.116 3700 has response,the glassfish is listen at 3700.

I don't know what cause this ploblem,need more configuration of Glassfish or
some more jar lib to the program?

thanks

 

 


--
[Message sent by forum member 'lztang']
View Post: http://forums.java.net/node/883886