Hi,
I successfully performed a lookup using the InitialContext from a
Java client after setting all the properties to obtain the context for the conatiner in the locally running Oracle JDeveloper
IDE.
Following were the properties:
INITIAL_CONTEXT_FACTORY=com.evermind.server.rmi.RMIInitialContextFactory
SECURITY_PRINCIPAL=admin
SECURITY_CREDENTIALS=welcome
PROVIDER_URL=ormi://localhost:23891/current-workspace-app
However, once I ported the application to Oracle 9iAS and changed the PROVIDER_URL to -
PROVIDER_URL=ormi://<server ip>:23791/appname
all jndi lookups fail, whether to call a method on some
ejb or to obtain a datasource. My client is a Java client invoked from a batch file. DataSource name in the Application server is given as "DIS" - which translates to "jdbc/DISDS" while performing lookups. Here's the code for the client which tries to get the datasource:
=====================================
Hashtable props = new Hashtable();
props.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
props.put(Context.SECURITY_PRINCIPAL, "admin");
props.put(Context.SECURITY_CREDENTIALS, "welcome");
props.put(Context.PROVIDER_URL, "ormi://192.100.100.239:23791/DISApplication");
Context ctx = new InitialContext(props);
javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup("jdbc/DISDS");
=====================================
I get the following exception on the line where the lookup is performed:
java.net.ConnectException: Connection refused.
What am I doing wrong?
Thanks, Rohit