One problem is that you are looking up JNDI_NAME = HelloWorld rather than COMP_NAME=java:comp/env/ejb/HelloWorld

If you really want you can make this work by passing the openejb proprietary naming properties into the new InitialContext() but it will no longer be a j2ee app.

thanks
david jencks

On Feb 15, 2006, at 12:39 PM, Sachin Patel wrote:

Ok this is bugging me now.  I've posted the 2 modules here... (both containing source)

http://people.apache.org/~sppatel/temp/

A free 6 pack of beer to anyone who can figure out whats wrong with my lookup :)

- sachin



On Feb 15, 2006, at 2:39 PM, Sachin Patel wrote:

and yes, TestEJB/TestEJB is the configID of the ejb module.  

- sachin



On Feb 15, 2006, at 2:27 PM, David Jencks wrote:

I doubt the <module>TestEJB/TestEJB</module> is correct.  Is this really the J2EEModule key of the ejb's object name?  I always end up looking in geronimo.log for the correct name.  You might try <module>*</module>

We are planning to make this easier in the configid branch so you only have to specify the <name>HelloWorld</name> part.

thanks
david jencks

On Feb 15, 2006, at 11:09 AM, Sachin Patel wrote:

Ok, I know I'm missing something but can't seem to find what... I've deployed a standalone ejbjar and standalone war that contains and ejbref.  When launching the servlet the lookup to my ejb fails...

javax.naming.NameNotFoundException: HelloWorld
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:90)
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:98)
at javax.naming.InitialContext.lookup(InitialContext.java:347)

What am I missing??????

In my openejb-jar.xml I have:

<enterprise-beans> 
  <session>
   <ejb-name>HelloWorld</ejb-name>
   <jndi-name>HelloWorld</jndi-name>
  </session> 
</enterprise-beans> 

In my web.xml I have:

<ejb-ref>
    <ejb-ref-name>ejb/HelloWorld</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>org.apache.test.HelloWorldHome</home>
    <remote>org.apache.test.HelloWorld</remote>
</ejb-ref>

In my geronimo-web.xml I have:

<sys:import>
    <sys:uri>TestEJB/TestEJB</sys:uri>
</sys:import>

<nam:ejb-ref>
    <nam:ref-name>ejb/HelloWorld</nam:ref-name>
    <nam:domain>geronimo.server</nam:domain>
    <nam:server>geronimo</nam:server>
    <nam:application>null</nam:application>
    <nam:module>TestEJB/TestEJB</nam:module>
    <nam:type>StatelessSessionBean</nam:type>
    <nam:name>HelloWorld</nam:name>
</nam:ejb-ref>


- sachin