On Thu, 11 Jan 2001 09:10:40 -0000, "Bordet, Simone" <[EMAIL PROTECTED]> said:

Bordet> Hey, you need a jndi.properties file in the classpath (inside
Bordet> your jar/war), so that when you create InitialContext it knows
Bordet> which class to use to create the context. Another solution is
Bordet> setting these properties in the code, not recommended

Bordet> HTH,
Bordet> Simon

Hi, I've been trying to get a servlet to talk with an EJB (using the
bundled jboss+tomcat binary from the JBoss web site). If I set the
JNDI properties in the servlet code with System.setProperty(...)
everything works fine, but so for I haven't managed to get the
jndi.properties style of configuration to work.

Where should I put the jndi.properties file? In the war file? In the
ear file? And where in there? I've pried various combinations, and
everything results in:

javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an
application resource file: java.naming.factory.initial

(i.e. the servlet isn't finding the properties). I'm using the Sun JDK
1.3 under Linux, in case it matters.

Here are the jndi.properties I'm trying to set:

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=localhost
java.naming.factory.url.pkgs=org.jboss.naming

Any clues?

//Petri


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to