users@glassfish.java.net

GF 3.1.1: using -Dorg.omg.CORBA.ORBInitialHost in JVM invocation works, but

From: <forums_at_java.net>
Date: Mon, 26 Sep 2011 17:15:24 -0500 (CDT)

 Please help.

  When I specify -Dorg.omg.CORBA.ORBInitialHost in the JVM invocation,
standalone client connects to server without any problem. However, I need to
be able to specify org.omg.CORBA.ORBInitialHost programmatically. For
example,   props.put("java.naming.factory.initial",
"com.sun.enterprise.naming.SerialInitContextFactory");  
props.put("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");  
props.put("java.naming.factory.state",
"com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");  
props.setProperty("org.omg.CORBA.ORBInitialHost", "172.16.0.3");  // my
remote server is at this IP address  
props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");   ...   context
= new javax.naming.InitialContext(props);   queueConnectionFactory =
(javax.jms.QueueConnectionFactory)context.lookup(connectionFactory);  
connection = (Connection)queueConnectionFactory.createQueueConnection();  
//EXCEPTION   Using the properties specified above and invoking the JVM
without -Dorg.omg.CORBA.ORBInitialHost, yields a connection exception. The
exception is telling me that "localhost" is being used, not the IP of the
server that my standalone client is trying to reach.   How do I go about
overriding the "localhost" default with my [user configurable] programmatic
setting???  Can the properties be specified programmatically?  Specifying
the -D option when invoking the JVM is not an option for us.   Thanks for
any help you can provide.   Kris

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