I don't understand exactly, did you change your jndi.properties by adding
correct properties for your JBoss server or did you set the environment
propertiesin your code??
If you changed your jndi.properties and it doesn't work, you can try to
start your tomcat server with -D option :
ex : -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
for each system property you need, added in tomcat.bat

SAINT-MARTIN Cecile
[EMAIL PROTECTED]

> -----Message d'origine-----
> De : [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]De la part de Jim Downing
> Envoy� : lundi 6 ao�t 2001 17:33
> � : [EMAIL PROTECTED]
> Objet : [JBoss-user] Stand alone tomcat
>
>
> Hi all,
> I'd really appreciate some help understanding how to make
> jndi.properties in
> a webapp point at the jboss naming service.
>
> I have a web app that deploys and runs fine on the integrated JBoss/tomcat
> stack. I'm trying to reconfigure this so that tomcat runs
> independently.  My
> problem is in obtaining an initial naming context to look up my
> EJBs.  If I
> set the naming environment properties in code it works fine, but
> I'd like to
> avoid having to set them this way. When trying to look up an EJB from the
> webapp I get: -
>
> 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
>
> jndi.properties file is in the WEB-INF/classes directory. I'm fairly sure
> tomcat can find my jndi.properties as it successfully finds other
> properties
> files in that directory.
>
> Any help would be massively appreciated. Version info, code and full stack
> trace below: -
>
> Running JBoss 2.2.2, Tomcat 3.2.2 on Win98. JDK1.3
>
> The code (part of file PersonSearchAction.java, a struts Action class):
>             /* This way works
>             java.util.Properties env = new java.util.Properties();
>             env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> "org.jnp.interfaces.NamingContextFactory");
>             env.setProperty(Context.PROVIDER_URL, "localhost:1099");
>             env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming");
>             Context ic=new InitialContext(env);
>            */
>
>            /* Commented out when block above uncommented... */
>             Context ic = new InitialContext();
>
>             Object objref = ic.lookup("PersonEJB");
>             PersonHome home =
>               (PersonHome) PortableRemoteObject.narrow(objref,
> PersonHome.class);
>             Collection all = home.findAll();
>
> jndi.properties:
> java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
> java.naming.provider.url=localhost:1099
> java.naming.factory.url.pkgs=org.jboss.naming
>
> Stack trace:
> 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
>    at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:646)
>    at
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
>    at
> javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.
> java:283)
>    at javax.naming.InitialContext.lookup(InitialContext.java:350)
>    at
> com.paribus.hemlatta.clients.people.PersonSearchAction.perform(Per
> sonSearchA
> ction.java:84)
>    ...
>
>
> Thanks,
> Jim
> [EMAIL PROTECTED]
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user


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

Reply via email to