You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Thomas Lindback <th...@yahoo.com> on 2006/07/15 09:04:28 UTC

About lookup ejb deployed separate from a servlet

Hello. 
I am evaluating geronimo-1.1. I have tested all
bean-types and run them with standalone clients and it
works great. No problem.

Now I am trying to access a bean from a servlet.
I am deploying the beans as a separate jar and the web
part is in its own war just to simulate some parts of
a real application.
I don't seem to be able to successfully configure the
ejb-ref. 


The servlet code:
  InitialContext ctx = new InitialContext();
  Object o = ctx.lookup(
     "java:comp/env/ejb/UserFacade");
  UserFacadeHome home = (UserFacadeHome) 
     PortableRemoteObject.narrow(
     o, UserFacadeHome.class);
  UserFacade remote = home.create();


web.xml:
    .....
    <ejb-ref>
        <ejb-ref-name>ejb/UserFacade</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <home>teel.interfaces.UserFacadeHome</home>
        <remote>teel.interfaces.UserFacade</remote>   
    
     </ejb-ref>

geronimo-web.xml:
      ....
      <!--    the ejb jar file      -->
      <dep:dependencies>
          <dep:dependency>
              <groupId>teel</groupId>
              <artifactId>MyFirstEntity</artifactId>
              <version>1.0</version>
              <type>jar</type>
          </dep:dependency>
      </dep:dependencies>


    <naming:ejb-ref>           
<naming:ref-name>ejb/UserFacade</naming:ref-name>
        <pattern>
            <groupId>teel</groupId>
            <artifactId>MyFirstEntity</artifactId>
            <version>1.0</version>
           
<module>teel/MyFirstEntity/1.0/jar</module>
            <name>UserFacade</name>
        </pattern>
    </naming:ejb-ref>

In geronimo-web.xml for the ejb-ref I have tried
almost all combinations already. 

The lookup in the servlet generates:
javax.naming.NameNotFoundException: Could not resolve
abstract name query [teel/
MyFirstEntity/1.0/car?EJBModule=teel/MyFirstEntity/1.0/jar,name=UserFacade#org.o
penejb.EJBContainer] in configuration
teel/HelloWorldWeb/1.0/war

Can anyone see what is wrong? Thanks in advance.
Thomas.




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com