• Post Reply Bookmark Topic Watch Topic
  • New Topic

JNDI starting off problem  RSS feed

 
Darryl Nortje
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone, firstly I hope this is the right forum to post this problem to. I couldn't see any other jndi forums, which is quite surprising considering the *great* tutorials around. I've just gone through suns tutorial for jndi, and the problem I'm coming up with is this
javax.naming.CommunicationException [Root exception is org.omg.CORBA.COMM_FAILURE: minor code: 3 completed: No]
Whenever it executes the line
Context ctx = new InitialContext();
This is the whole method where I try to make the DataSource avail accross jndi.
if (readConfigFile()) {
MysqlDataSource ds = new MysqlDataSource();
ds.setUser(dbLogin);
ds.setPassword(dbPassword);
ds.setServerName(dbServer);
ds.setUrl(dbUrl);
try {
Hashtable env = new Hashtable();
//env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.ejs.ns.jndi.CNInitialContextFactory");
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.ejs.cm.DataSourceFactory");
//env.put("java.naming.rmi.security.manager", "yes");
Context ctx = new InitialContext();
ctx.bind("jdbc/docserverDB", ds);
} catch (NamingException ne) {
System.out.println("Problem trying to link data source to JNDI");
ne.printStackTrace();
}
}
If anybody can please give me some pointers as to what I'm doing wrong here.
Also If it makes a difference, (and I think it does) I am using Ibm Visual (r)age for java 4.0 and Websphere Test Environment for testing and debugging purposes. Deployment is going onto JBoss tomcat, but I also plan to use the jndi.properties file instead of the Hashtable put.... for the INITIAL_CONTEXT_FACTORY.
So, ja, Any help would be greatly appreciated.
Thanks
Darryl
 
Graham Thorpe
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think so this is the problem as Classpath .I mean com.ibm.ejs.cm.DataSourceFactory" didint set the classpath.Pls try to set classpath then only u can get the result.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!