Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_java_server thread: javax.naming.NoInitialContextException when trying to use DataSource in the Movie Catalog


Message #1 by "Gabe Camacho" <gcamacho@s...> on Wed, 29 May 2002 16:25:53
There are a couple of ways to provide the necessary information to create
the Context properly.

You can either hardcode it using a Properties object, e.g.

Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY, 
         "weblogic.jndi.WLInitialContextFactory");
prop.put(Context.PROVIDER_URL, "t3://localhost:7001");

InitialContext ctx = new InitialContext(prop);
Obviously the above properties are for a WebLogic server. The exact
properties you need are server specific, plus some servers may require
additional properties such as security info.

You could also read the info in from a properties file.

  Return to Index