Thanks for the answer. I have decided to package the 2 modules in an ear file, as deploying them separately is much more difficult than what I thought. Now, after creating the ear, when trying to deploy the ear file I get this trace:

C:\geronimo-1.0-M4>java -jar bin\deployer.jar --user system --password manager deploy ../EjemploEJB/build/META-INF/dist/aplicacion.ear
   Error: Unable to distribute aplicacion.ear: Invalid moduleFile:
   dist/ejemploServletEJB.war caused by Jar entry does not exist:
jarFile=C:\DOCUME~1\IIGOMU~1\CONFIG~1\Temp\deployer15274.tmpdir\aplicacion.e
ar,
   path=dist/ejemploServletEJB.war

but ejemploServletEJB.war exists and is in that directory so I don't know how to continue. The application.xml I have is this:
<?xml version="1.0" encoding="ISO-8859-1"?>

<application>
   <display-name>Servlet comunicando con EJB de Sesión</display-name>
   <module>
   <web>
       <web-uri>dist/ejemploServletEJB.war</web-uri>
       <context-root>/EjemploServletEJB</context-root>
   </web>
   </module>

   <module>
       <ejb>dist/ejemploEJB.jar</ejb>
   </module>

</application>

And the deployment plan geronimo-application.xml is this:

<?xml version="1.0" ?>
<application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application";
 configId="AplicacionServletEJB"
 parentId="org/apache/geronimo/Server">
   <module>
   <ejb>dist/ejemploEJB.jar</ejb>
   </module>
   <module>
   <web>dist/ejemploServletEJB.war</web>
   </module>
 </application>

David Jencks escribió:

The simplest solution is to package your 2 modules in an ear file. Otherwise you will have to include a geronimo-web.xml with an ejb-ref that indicates that the ejb is in your ejb module. We only try to auto-resolve ejb references within the current application.

If you wish to continue with separate modules I think something like this is necessary:

<ejb-ref>
  <ref-name>prueba/MyTestSessionBean</ref-name>
  <module> EjemploEJB</module>
  <name> MyTestSession<name>
</ejb-ref>

I wrote this from memory so there may be numerous mistakes.

Also, you need to look up "java:comp/env/prueba/MyTestSessionBean" and you should remove the jndi-name element: it is used only for lookup in standalone clients and in corba.

Hope this helps
david jencks


Reply via email to