Scott, thanks for the reply.  I get an NPE when I delete the jndi.properties
file.

Here's the code for org.jboss.naming.NamingService.initService() in JBoss
2.2.1.  Without the jndi.properties file, the System.getProperties... line
gets an NPE.  With the jndi.properties file in place, the Context ctx = ...
line gets a ConnectionException.  If the jndi.properties file contains no
provider url, the Context ctx = ... line gets a ConfigurationException
saying "Provider URL missing."

Tim Taylor

public void initService()
   throws Exception
{
   // Read jndi.properties into system properties
   // RO: this is necessary because some components (=Tomcat servlets) use a

   // buggy classloader that disallows finding the resource properly
 
System.getProperties().load(Thread.currentThread().getContextClassLoader().g
etResourceAsStream
   ("jndi.properties"));
   
   // Create "java:comp/env"
   RefAddr refAddr = new StringRefAddr("nns", "ENC");
   Reference envRef = new Reference("javax.naming.Context", refAddr,
ENCFactory.class.getName(), null);
   Context ctx = (Context)new InitialContext().lookup("java:");
   ctx.rebind("comp", envRef);
}

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to