Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JMS: context = (Context) new InitialContext(env); hangs

807591May 15 2008 — edited May 20 2008
Hi

I got a problem with setting InitialContext.
When running the code from commandline, I got no problems what so ever getting connection to a MQ-server.
When I deploy the same code to be used as a servlet on Orion Webserver, the InitialContext hangs when running the lines:
String mqServer = "???.???.???.???"; // MARK: commented out real IP
String mqServerPort = "3700";
Hashtable env = new Hashtable();
env.put("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
env.put("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
env.put("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
		    
env.put("org.omg.CORBA.ORBInitialHost",	mqServer);
env.put("org.omg.CORBA.ORBInitialPort",	mqServerPort); 		  
 		
env.put(Context.PROVIDER_URL, "iiop://"+mqServer+":"+mqServerPort);

Context context = (Context) new InitialContext(env);   // FREEZES here; nothing more happens
//...
Sum up:*
I'm Connecting to a Sun Application Server's MQ, and the server is external.
My local commandline connect perfectly and receives and delivers as it should.
For some reason the Orion session hangs for this code-snippet
I also had to unzip the appserv-rt.jar to be able to load the SerialInitContextFactory, since Orion went out of memory when applying it as it was to classpath or orion lib folder; please advice

I've tried RMIInitialContextFactory amongst others, but the protocol set up there doesn't seem to compute with the Sun App server (9.1 btw).
I got the port 3700 opened up at firewall settings, so connection through that port

Please help :)

Cincerely Paul
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 17 2008
Added on May 15 2008
4 comments
484 views