martes, 15 de noviembre de 2011

Unable to load the EJB module. DeploymentContext does not contain any EJB.


DeploymentContext does not contain any EJB. If you use EJB component annotations to define the EJB, and an ejb or web deployment descriptor is also used, please make sure that the deployment descriptor references a Java EE 5 or higher version schema, and that the metadata-complete attribute is not set to true, so the component annotations can be processed as expected. -- it happens because you are using in the Lib Ejb ... the "Interfaces" and the "Services entity manager"... so the server show you that those entity manager it is actually defined.


This problem happens when you are defined and using in a incorrect way your EJB lib .jar

You have to be clear in that points:


1- You create an EAR file----------who is composed by (Entities, Interfaces, Services Entity Manager)
2. You have to create a .jar file with (Entities and Interfaces) WITH THIS I FIXED THE THE PROBLEM, because i had used (Entities, Interfaces, Services Entity Manager) and that was wrong,

3. Export the EAR and deploy it on the server.
4. Export the .jar to the : Server Library path: /Glassfish3/glassfish/domain/domain1/lib

5. Create a Client Application and add the .jar file exported in the 4 step in the builtpath .
6. Add other libs as Vaadin addons and vaadin.6-6-3.jar in the WEB-INF/lib path.
7. Add BonitaClient.jar that is located on the silvia/bonitaApplications2/runtime/lib/client

8. Deploy client Application in glassfish.



Other solutions i have found:
-------------

Changing web.xml to have this seemed to at least allow it to come up in Glassfish 3.1.

http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">

Not obvious.

------------------

Ok, found the cause (thanks much for providing the test case!):

1. EjbSniffer was retrieved after scanning the archive: one (or more) of the
library jars packaged in the archive contains EJBs with component annotations.
So the ejb container was asked to load the module later.
2. The ejb container was not able to find the corresponding metadata because the
web.xml is 2.4 version so the meta-data processing skipped the annotation
processing (we only process annotations for Java EE 5+ schema versions).

After I changed the web.xml to reference 2.5 schema (you can do 3.0 schema as well):
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

The app deployed successfully.

Please give it a try and let me know if it works for you


El error dice que no encuentra las clases... si estan en WEB-INF/lib, lo unico que se me ocurre es que esten mas de una vez en el classpath. Comprueba no tener varias versiones de esos jar en el classpath (WEB-INF/lib, CLASSPATH de sistema, carpeta lib del tomcat...)

Algo asi deber ser.
S!


references: http://www.forosdelweb.com/f45/jars-externos-jsp-625395/

http://javarevisited.blogspot.com/2011/08/classnotfoundexception-in-java-example.html -- excellent