You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by giluka <gm...@sivaspa.com> on 2002/06/18 08:56:45 UTC

Tomcat 4 & JNDI

I've a problem:
i want to call my EJB resource (running on a remote machine on JBoss 3.0) from a servlet
(running on my local machine).
I've tried to put in classpath jndi.properties file like this:

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=remote-machine
java.naming.factory.url.pkgs=org.jboss.naming.org.jnp.interfaces

and to modify web-xml file:

<resource-env-ref>
    <resource-env-ref-name>AddressEJBHome</resource-env-ref-name>
    <resource-env-ref-type>com.sun.j2ee.blueprints.address.ejb.AddressEJBBean</r
esource-env-ref-type>
</resource-env-ref>

can you help me ?






Re: Tomcat 4 & JNDI

Posted by Richard Plukker <ri...@bowtie.nl>.
giluka wrote:

>I've tried that but it does not still works ...
>It is correct to put jndi.properties (with information that point to my ejb
>server) file in my classpath ?
>
>----- Original Message -----
>From: "Richard Plukker" <ri...@bowtie.nl>
>To: "Tomcat Users List" <to...@jakarta.apache.org>
>Sent: Tuesday, June 18, 2002 9:27 AM
>Subject: Re: Tomcat 4 & JNDI
>
>
>  
>
>>In tomcat 4 you can also use the ejb-ref element in the server.xml
>>look at the tomcat examples, hope it will work.
>>good luck
>>
>>On Tuesday 18 June 2002 08:56, you wrote:
>>    
>>
>>>I've a problem:
>>>i want to call my EJB resource (running on a remote machine on JBoss
>>>      
>>>
>3.0)
>  
>
>>>from a servlet (running on my local machine).
>>>I've tried to put in classpath jndi.properties file like this:
>>>
>>>java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
>>>java.naming.provider.url=remote-machine
>>>java.naming.factory.url.pkgs=org.jboss.naming.org.jnp.interfaces
>>>
>>>and to modify web-xml file:
>>>
>>><resource-env-ref>
>>>    <resource-env-ref-name>AddressEJBHome</resource-env-ref-name>
>>>
>>>
>>>      
>>>


><resource-env-ref-type>com.sun.j2ee.blueprints.address.ejb.AddressEJBBean</
>  
>
>>>r esource-env-ref-type>
>>></resource-env-ref>
>>>
>>>can you help me ?
>>>      
>>>
>>--
>>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>
>
>  
>

You should try to start tomcat with a

# java -Djava.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory \
      -Djava.naming.provider.url=ldap://localhost:389/o=jnditutorial \
      List
# java -Djava.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory \
      -Djava.naming.provider.url=file:/tmp \
      List 
  

You should take a look at the jndi 
tutorial:http://java.sun.com/products/jndi/tutorial/beyond/env/source.html



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


Re: Tomcat 4 & JNDI

Posted by giluka <gm...@sivaspa.com>.
I've tried that but it does not still works ...
It is correct to put jndi.properties (with information that point to my ejb
server) file in my classpath ?

----- Original Message -----
From: "Richard Plukker" <ri...@bowtie.nl>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, June 18, 2002 9:27 AM
Subject: Re: Tomcat 4 & JNDI


> In tomcat 4 you can also use the ejb-ref element in the server.xml
> look at the tomcat examples, hope it will work.
> good luck
>
> On Tuesday 18 June 2002 08:56, you wrote:
> > I've a problem:
> > i want to call my EJB resource (running on a remote machine on JBoss
3.0)
> > from a servlet (running on my local machine).
> > I've tried to put in classpath jndi.properties file like this:
> >
> > java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
> > java.naming.provider.url=remote-machine
> > java.naming.factory.url.pkgs=org.jboss.naming.org.jnp.interfaces
> >
> > and to modify web-xml file:
> >
> > <resource-env-ref>
> >     <resource-env-ref-name>AddressEJBHome</resource-env-ref-name>
> >
> >
<resource-env-ref-type>com.sun.j2ee.blueprints.address.ejb.AddressEJBBean</
> >r esource-env-ref-type>
> > </resource-env-ref>
> >
> > can you help me ?
>
> --
> 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: Tomcat 4 & JNDI

Posted by Richard Plukker <ri...@bowtie.nl>.
In tomcat 4 you can also use the ejb-ref element in the server.xml
look at the tomcat examples, hope it will work.
good luck

On Tuesday 18 June 2002 08:56, you wrote:
> I've a problem:
> i want to call my EJB resource (running on a remote machine on JBoss 3.0)
> from a servlet (running on my local machine).
> I've tried to put in classpath jndi.properties file like this:
>
> java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
> java.naming.provider.url=remote-machine
> java.naming.factory.url.pkgs=org.jboss.naming.org.jnp.interfaces
>
> and to modify web-xml file:
>
> <resource-env-ref>
>     <resource-env-ref-name>AddressEJBHome</resource-env-ref-name>
>    
> <resource-env-ref-type>com.sun.j2ee.blueprints.address.ejb.AddressEJBBean</
>r esource-env-ref-type>
> </resource-env-ref>
>
> can you help me ?

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