users@glassfish.java.net

Re: JMS destination lookup doesn't work on GlassFish 3.1.1 with

From: <forums_at_java.net>
Date: Tue, 11 Oct 2011 14:03:14 -0500 (CDT)

The jndi lookup fails, below is the code .  I do see the "got
InitialContext..." message on command prompt. The system hangs after that. I
do not see "got connection factory ..." message. after printing the first
message it just waits for ever.

   jndiContext = new InitialContext(); //set this up, may be overwritten
later
           
            Properties p = new Properties();
            p.setProperty("java.naming.factory.initial",
"com.sun.enterprise.naming.impl.SerialInitContextFactory");
            p.setProperty("java.naming.factory.url.pkgs",
"com.sun.enterprise.naming");
            p.setProperty("java.naming.factory.state",
"com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
            p.setProperty("org.omg.CORBA.ORBInitialHost",
"ulinux1.fsgn.net");
            p.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
//any configured port different from 3700
           
            System.setProperty("org.omg.CORBA.ORBInitialHost",
"ulinux1.fsgn.net");
            System.setProperty("org.omg.CORBA.ORBInitialPort",
"3700");
           
            jndiContext = new InitialContext(p);
           
           
            System.out.println("got InitialContext .....");
                      
            connectionFactory =
(ConnectionFactory)jndiContext.lookup("jms/MyJMSConnectionFactory");
            System.out.println("got connection factory.....");
       

            queue = (Queue)jndiContext.lookup("jms/MyJMSQueue");
            System.out.println("got queue .....");


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