4 Replies Latest reply on Aug 3, 2011 11:35 AM by figwam

    Failed to start service jboss.persistenceunit inside EAR


      Hi @ll,


      after spending many hours and reading forums, I hope for your help:


      I have persistence a module, let say persistence-module.jar


      persistance.xml inside META-INF


      <?xml version="1.0" encoding="UTF-8"?>

      <persistence version="2.0"

         xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"




                <persistence-unit name="myUnit">





      A class AccountDb.java



      @Table(name = "ACCOUNT")

      public class AccountDb{...}



      Now the problem



      If I deploy the module.jar inside WAR file, the deployment works fine! I can also persist

      the Entity using EnitiyManager.



      If I deploy the module.jar inside EAR file (the persistence-module.jar is in the root of EAR), the deployment fail with:

      ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.persistenceunit

      Caused by: java.lang.ClassNotFoundException: com.model.AccountDb from [Module "deployment.module.ear.persistence-module.jar:main" from Service Module Loader]


      But the class is inside the jar file, this must be a class loading problem.

      After reading this article: https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7


      a.) I tried to add a dependency to META-INF/MANIFEST.MF


      Manifest-Version: 1.0


      Dependencies: deployment.module.ear.persistence-module.jar export


      b.) I also tried to disable isolated deployment:

      <subsystem xmlns="urn:jboss:domain:ee:1.0" >           




      c.) I put beans.xml into META-INF of the persistence-module.jar


      META-INF/application.xml (generated by maven EAR plugin v2.6) of EAR looks like:

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE application PUBLIC

                "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"










      But still the same error occur


      What do I wrong in case 2?


      many thx