geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gianny Damour <gianny.dam...@optusnet.com.au>
Subject Re: Remote EJB client apps
Date Wed, 15 Mar 2006 22:23:52 GMT
Hi,

Here is how to get an initial context:
        Properties p = new Properties();
        p.put("java.naming.factory.initial", 
"org.openejb.client.RemoteInitialContextFactory");
        p.put("java.naming.provider.url", "127.0.0.1:4201");
          
        InitialContext ctx = new InitialContext(p);
        BasicStatefulHome home = (BasicStatefulHome) 
ctx.lookup("client/tests/stateless/BasicStatelessHome");

And how to declare the JNDI name in the openejb-jar.xml DD:
        <session>
            <ejb-name>BasicStatefulBean</ejb-name>
            <jndi-name>client/tests/stateless/BasicStatelessHome</jndi-name>

Thanks,
Gianny

Aaron Mulder wrote:

>Actually, application clients are the one thing that can use JNDI
>lookups to access EJBs (but not other components such as JMS or JDBC
>resources) -- that's what the jndi-name setting in openejb-jar.xml is
>used for.  If you have a J2EE application client (that runs in a
>client container) then you can still use java:comp/env for everything,
>but if you have a client that does not run in a client container then
>you need the InitialContext settings like you're talking about.
>
>Unfortunately, I don't have those settings off the top of my head -- I
>know it's been on the mailing list before though.
>
>Thanks,
>   Aaron
>
>On 3/15/06, David Carew <dccarew@gmail.com> wrote:
>  
>
>>By "Remote EJB client apps" I mean a standalone app running  a different
>>machine  from the Geronimo server accessing EJBs running on the Geronimo
>>server.
>>
>>What are the properties required for InitialContext for a remote EJB Client
>>doing a JNDI lookup ?
>>
>>Besides the stubs specific to the EJBs I need to call, what jar files do I
>>need in the remote client JVMs classpath ?
>>
>>I've seen in a few threads where it has been said that Geronimo doesn't have
>>a Global JNDI namespace. If I understand this correctly all JNDI lookups
>>(including those from remote EJB clients) must be done via java:comp/env. Is
>>that correct ?
>>
>>TIA
>>
>>
>>
>>    
>>
>
>
>  
>



Mime
View raw message