You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mauricio Nuñez <mn...@maxmedia.cl> on 2002/08/13 18:51:29 UTC

Tomcat 4.1.7 + remote Jboss (SUCCEFUL)

Hi,

I'm trying to get Jboss + Tomcat working remotely.
At my test server, I install Tomcat 4.1.7 and Jboss 3.0.1 standalone.

To get my code working, i put my jdni.properties file at
WEB-INF/classes, copy all the client jars to WEB-INF/lib, and my test
ejb jar.

Then,I added and ejb-ref entry at my web.xml, defining an "ejb/Storage"
name.

>From my code, I used the tomcat' InitialContext, getting an valid
reference to my deployed EJB.

ctx.lookup("java:comp/env/ejb/Storage")

My question is:

Are all these steps necessary , or exists a shorter approach ?

Any comments are welcome.

Thanks

---------------------------------------------------------------------

my jndi.properties in WEB-INF/classes

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

my web.xml:

<ejb-ref>
     <description>Prueba de coneccion con ejb</description>
     <ejb-ref-name>ejb/Storage</ejb-ref-name>
     <ejb-ref-type>Session</ejb-ref-type>
     <home>com.chile.ejb.test.StorageHome</home>
     <remote>com.chile.ejb.test.Storage</remote>
     <ejb-link>jnp://localhost:1099/Storage</ejb-link>
</ejb-ref>


my code:

javax.naming.InitialContext ctx=new javax.naming.InitialContext();

StorageHome home = (StorageHome) javax.rmi.PortableRemoteObject.narrow(
ctx.lookup("java:comp/env/ejb/Storage") , StorageHome.class);






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