geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Four Sticks" <fours...@gmail.com>
Subject NameNotFoundException with EJB created with Eclipse Geronimo plugin
Date Sun, 06 Aug 2006 19:50:01 GMT
Hi,

I have eclipse 3.2, the Callisto version of WebTools, JDK 1.5 and the
Geronimo 1.1 plugin.  I'm able to create and run serverlets and JSP's
just fine to Geronimo, but I'd like to learn about EJB's.

I'm using this tutorial as a guide:
http://www.eclipse.org/webtools/community/tutorials/ejbtutorial/buildingejbs.html

Following this tutorial, I created an EJB project named Zoo, a Web
project named ZooWeb and an EAR named ZooEAR. In the Zoo EJB project
is an EJB named TigerBean.  The plugin created a ZooClient project. In
the Web project is a JSP page named Test.jsp which gets the EJB and
calls a method on it.

It looked like everything created fine, but when I run the project on
the Geronimo server. The JSP page is failing on the following line of
java code:

com.zoo.example.TigerHome home = com.zoo.example.TigerUtil.getHome();

with the following error:

javax.naming.NameNotFoundException: Tiger

My question is what do I need to do so the JSP page can find the EJB?

Here is the web.xml file creatd by the plugin:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
 <display-name>
 ZooWeb</display-name>
 <welcome-file-list>
  <welcome-file>index.html</welcome-file>
 </welcome-file-list>
</web-app>

There is also a geronimo-web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1"
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1"
xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1"
xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1">
  <sys:environment>
    <sys:moduleId>
      <sys:groupId>default</sys:groupId>
      <sys:artifactId>ZooWeb</sys:artifactId>
      <sys:version>1.0</sys:version>
      <sys:type>car</sys:type>
    </sys:moduleId>
  </sys:environment>
  <context-root>/ZooWeb</context-root>
</web-app>

Do I need to add something to these two files? I'd appreciate any help
at all.  I'm not to familiar with EJB's so I'm not sure what I need to
do so that the JSP page can find them.

In the Zoo Ejb project the ejb-jar.xml file has the following:
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar id="ejb-jar_1" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" version="2.1">
   <description><![CDATA[Zoo generated by eclipse wtp xdoclet
extension.]]></description>
   <display-name>Zoo</display-name>

   <enterprise-beans>

      <!-- Session Beans -->
      <session id="Session_Tiger">
         <description><![CDATA[An EJB named Tiger]]></description>
         <display-name>Tiger</display-name>

         <ejb-name>Tiger</ejb-name>

         <home>com.zoo.example.TigerHome</home>
         <remote>com.zoo.example.Tiger</remote>
         <local-home>com.zoo.example.TigerLocalHome</local-home>
         <local>com.zoo.example.TigerLocal</local>
         <ejb-class>com.zoo.example.TigerSession</ejb-class>
         <session-type>Stateless</session-type>
         <transaction-type>Container</transaction-type>

      </session>

     <!--
       To add session beans that you have deployment descriptor info for, add
       a file to your XDoclet merge directory called session-beans.xml
that contains
       the <session></session> markup for those beans.
     -->

      <!-- Entity Beans -->
     <!--
       To add entity beans that you have deployment descriptor info for, add
       a file to your XDoclet merge directory called entity-beans.xml
that contains
       the <entity></entity> markup for those beans.
     -->

      <!-- Message Driven Beans -->
     <!--
       To add message driven beans that you have deployment descriptor
info for, add
       a file to your XDoclet merge directory called
message-driven-beans.xml that contains
       the <message-driven></message-driven> markup for those beans.
     -->

   </enterprise-beans>

   <!-- Relationships -->

   <!-- Assembly Descriptor -->
     <!--
       To specify your own assembly descriptor info here, add a file to your
       XDoclet merge directory called assembly-descriptor.xml that contains
       the <assembly-descriptor></assembly-descriptor> markup.
     -->

   <assembly-descriptor id="AssemblyDescriptor_1">
     <!--
       To specify additional security-role elements, add a file in the merge
       directory called ejb-security-roles.xml that contains them.
     -->

   <!-- method permissions -->
     <!--
       To specify additional method-permission elements, add a file in the merge
       directory called ejb-method-permissions.ent that contains them.
     -->

   <!-- transactions -->
     <!--
       To specify additional container-transaction elements, add a
file in the merge
       directory called ejb-container-transactions.ent that contains them.
     -->

   <!-- finder transactions -->

   <!-- message destinations -->
     <!--
       To specify additional message-destination elements, add a file
in the merge
       directory called ejb-message-destinations.ent that contains them.
     -->

   <!-- exclude list -->
     <!--
       To specify an exclude-list element, add a file in the merge directory
       called ejb-exclude-list.xml that contains it.
     -->
   </assembly-descriptor>

   <ejb-client-jar>ZooClient.jar</ejb-client-jar>

</ejb-jar>

And there is also an openejb-jar.xml file in the EJB projcect with the
following:

<?xml version="1.0" encoding="UTF-8"?>
<openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1"
xmlns:pkgen="http://www.openejb.org/xml/ns/pkgen-2.0"
xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1"
xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1">
  <sys:environment>
    <sys:moduleId>
      <sys:groupId>default</sys:groupId>
      <sys:artifactId>Zoo</sys:artifactId>
      <sys:version>1.0</sys:version>
      <sys:type>car</sys:type>
    </sys:moduleId>
  </sys:environment>
  <enterprise-beans/>
</openejb-jar>

Any help at all would be gratefully appreciated it.

Thanks,
Gaston

Mime
View raw message