You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rod Frey <rf...@psychometrics.com> on 2002/12/13 17:39:12 UTC

InitialContext configuration

This question seems to have been asked about a thousand times: I
apologize for bringing it up again.  I was unable to find a solution
that worked from among prior responses.
 
I want to configure Tomcat's InitialContext with Jboss' JNDI info.  Life
is good as long as I do things in code:
 
      Hashtable env = new Hashtable();
      env.put("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
      env.put("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");
      env.put("java.naming.provider.url", "freud:1099");
      Context context = new InitialContext(env);


However, I obviously would like to put this in a jndi.properties file,
or externalize it in some other way.  I've tried putting the
jndi.properties file in the following locations:
 
$JAVA_HOME/lib
$JAVA_HOME/lib/ext
$TOMCAT_HOME/common/classes
$TOMCAT_HOME/common/shared
$TOMCAT_HOME/webapps/myapp/WEB-INF/classes
$TOMCAT_HOME/webapps/myapp/WEB-INF/lib
 
Nothing works: when I check system properties just before creating an
InitialContext, I get the following output:
 
    java.naming.factory.initial is
org.apache.naming.java.javaURLContextFactory
    java.naming.factory.url.pkgs is org.apache.naming
    java.naming.provider.url is null

Followed by the inevitable exception:
 
javax.naming.NameNotFoundException: Name PartnerManager is not bound in
this Context

How can I externalize these system properties?  I've also mucked with
the server.xml file quite extensively, without success.
 
I'm using Redhat 8.0, JDK1.4.1, and Tomcat 4.1.12.
 
Thanks!
Rod

RE: InitialContext configuration

Posted by Rod Frey <rf...@psychometrics.com>.
Thanks for the reply.

I should have mentioned that I started encountering these problems when
I put the Tomcat server on a different machine.  There was no trouble
when I was running Tomcat embedded.  Right now, there's no trace of
Jboss on the Tomcat server.

Thanks again!
Rod

-----Original Message-----
From: Jacob Kjome [mailto:hoju@visi.com] 
Sent: Friday, December 13, 2002 10:38 AM
To: Tomcat Users List
Subject: Re: InitialContext configuration


Hello Rod,

I think this is a JBoss question.  I think that JBoss takes over
configuration of Tomcat when Tomcat is embedded in JBoss.  So, I would
think that the JNDI config would be located within JBoss, not external
to the server or under the normal Tomcat standalone configuration. That
said, I haven't tried this and don't know for sure.  I just thought I'd
fill you in on my hunch.


Jake

Friday, December 13, 2002, 10:39:12 AM, you wrote:

RF> This question seems to have been asked about a thousand times: I 
RF> apologize for bringing it up again.  I was unable to find a solution

RF> that worked from among prior responses.
 
RF> I want to configure Tomcat's InitialContext with Jboss' JNDI info.  
RF> Life is good as long as I do things in code:
 
RF>       Hashtable env = new Hashtable();
RF>       env.put("java.naming.factory.initial",
RF> "org.jnp.interfaces.NamingContextFactory");
RF>       env.put("java.naming.factory.url.pkgs",
RF> "org.jboss.naming:org.jnp.interfaces");
RF>       env.put("java.naming.provider.url", "freud:1099");
RF>       Context context = new InitialContext(env);


RF> However, I obviously would like to put this in a jndi.properties 
RF> file, or externalize it in some other way.  I've tried putting the 
RF> jndi.properties file in the following locations:
 
RF> $JAVA_HOME/lib
RF> $JAVA_HOME/lib/ext
RF> $TOMCAT_HOME/common/classes
RF> $TOMCAT_HOME/common/shared 
RF> $TOMCAT_HOME/webapps/myapp/WEB-INF/classes
RF> $TOMCAT_HOME/webapps/myapp/WEB-INF/lib
 
RF> Nothing works: when I check system properties just before creating 
RF> an InitialContext, I get the following output:
 
RF>     java.naming.factory.initial is 
RF> org.apache.naming.java.javaURLContextFactory
RF>     java.naming.factory.url.pkgs is org.apache.naming
RF>     java.naming.provider.url is null

RF> Followed by the inevitable exception:
 
RF> javax.naming.NameNotFoundException: Name PartnerManager is not bound

RF> in this Context

RF> How can I externalize these system properties?  I've also mucked 
RF> with the server.xml file quite extensively, without success.
 
RF> I'm using Redhat 8.0, JDK1.4.1, and Tomcat 4.1.12.
 
RF> Thanks!
RF> Rod



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: InitialContext configuration

Posted by Jacob Kjome <ho...@visi.com>.
Hello Rod,

I think this is a JBoss question.  I think that JBoss takes over
configuration of Tomcat when Tomcat is embedded in JBoss.  So, I would
think that the JNDI config would be located within JBoss, not external
to the server or under the normal Tomcat standalone configuration.
That said, I haven't tried this and don't know for sure.  I just
thought I'd fill you in on my hunch.


Jake

Friday, December 13, 2002, 10:39:12 AM, you wrote:

RF> This question seems to have been asked about a thousand times: I
RF> apologize for bringing it up again.  I was unable to find a solution
RF> that worked from among prior responses.
 
RF> I want to configure Tomcat's InitialContext with Jboss' JNDI info.  Life
RF> is good as long as I do things in code:
 
RF>       Hashtable env = new Hashtable();
RF>       env.put("java.naming.factory.initial",
RF> "org.jnp.interfaces.NamingContextFactory");
RF>       env.put("java.naming.factory.url.pkgs",
RF> "org.jboss.naming:org.jnp.interfaces");
RF>       env.put("java.naming.provider.url", "freud:1099");
RF>       Context context = new InitialContext(env);


RF> However, I obviously would like to put this in a jndi.properties file,
RF> or externalize it in some other way.  I've tried putting the
RF> jndi.properties file in the following locations:
 
RF> $JAVA_HOME/lib
RF> $JAVA_HOME/lib/ext
RF> $TOMCAT_HOME/common/classes
RF> $TOMCAT_HOME/common/shared
RF> $TOMCAT_HOME/webapps/myapp/WEB-INF/classes
RF> $TOMCAT_HOME/webapps/myapp/WEB-INF/lib
 
RF> Nothing works: when I check system properties just before creating an
RF> InitialContext, I get the following output:
 
RF>     java.naming.factory.initial is
RF> org.apache.naming.java.javaURLContextFactory
RF>     java.naming.factory.url.pkgs is org.apache.naming
RF>     java.naming.provider.url is null

RF> Followed by the inevitable exception:
 
RF> javax.naming.NameNotFoundException: Name PartnerManager is not bound in
RF> this Context

RF> How can I externalize these system properties?  I've also mucked with
RF> the server.xml file quite extensively, without success.
 
RF> I'm using Redhat 8.0, JDK1.4.1, and Tomcat 4.1.12.
 
RF> Thanks!
RF> Rod



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>