RE: [JBoss-user] Access InitialContext of Tomcat 4.0.2

2002-05-23 Thread Jon Swinth

Dirk,

If you are trying to access the Tomcat JNDI from an external program then you 
are most likely out of luck since it doesn't look as if Tomcat is exposing it 
via a port like JBoss does.

"Tomcat 4 provides a JNDI InitialContext implementation instance to web 
applications running under it"

Key words being "under it".  You can read for yourself at:

http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html

If you want to access the JNDI from _within_ a Servlet then simply use:

Context jndiContext = new InitialContext() ;

If we have all misunderstood you and you are trying to access the JBoss JNDI 
from a standalone Tomcat then use this in your Servlet code:

Properties props = new Properties();
props.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
props.setProperty(Context.URL_PKG_PREFIXES,"org.jnp.interfaces");
props.setProperty(Context.PROVIDER_URL,"localhost:1099");
InitialContext jndiContext = new InitialContext(props);

Obviously change localhost if JBoss is running on a different machine.  You 
would also need to add a link to (linux) or copy the following files from 
$JBOSS_DIST/client to $CATALINA_HOME/lib :

jboss-client.jar
jboss-common-client.jar
jboss-j2ee.jar
jbosssx-client.jar
jnet.jar
jnp-client.jar
log4j.jar

Good luck.

> Message: 11
> From: "Dirk Storck" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Subject: AW: [JBoss-user] Access InitialContext of Tomcat 4.0.2
> Date: Thu, 23 May 2002 15:39:08 +0200
> Reply-To: [EMAIL PROTECTED]
>
> No from a stand alone Tomcat
> Thanks !
>
> > How can I access the InitialContext of Tomcat from whithin an
> > external java
> > programm?

___

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

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



RE: [JBoss-user] Access InitialContext of Tomcat 4.0.2

2002-05-23 Thread Coetmeur, Alain



> -Message d'origine-
> De: Dirk Storck [mailto:[EMAIL PROTECTED]]
> Date: jeudi 23 mai 2002 01:51
> À: Jboss User (E-Mail); Tomcat User (E-Mail)
> Objet: [JBoss-user] Access InitialContext of Tomcat 4.0.2
> 
> 
> 
> Hi,
> 
> I know it doesnt belongs to this mailing list but maybe 
> someone can help.
> 
> How can I access the InitialContext of Tomcat from whithin an 
> external java
> programm?

from the embedded catalina ?

there are no tomcat InitialContext, since jboss
propose it's own InitialContext...
to contact EJB and MBeans resources, just
include the jboss\client\jnp-client.jar, the jndi.properties
and alike as explained in jboss doc

http://www.jboss.org/online-manual/HTML/ch01s15.html

if you want to use a separate Tomcat, in order to
contact Jboss resources you need to add the
same jnp-client.jar, jndi.properties to the server classpath
(I think you can simply put it in the common/lib )

___

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

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