3 Replies Latest reply on Nov 22, 2007 11:17 AM by ABD KOU

    Deployment problems - persistence unit could not be created

    Davy De Winter Newbie

      Hi all,

      being new to JBoss, i have some problems deploying my first EJB 3.0 entity-and session-beans. While trying to deploy my ear-package, containing an EJB-jar package with the entity-beans, I get the following error-message in the debug output (JBoss-4.2.0-GA):

      2007-07-15 15:23:08,406 INFO [org.jboss.ejb3.entity.PersistenceUnitDeployment] Starting persistence unit persistence.units:ear=texaco_deploy-1.0-SNAPSHOT.ear,jar=texaco_model-1.0-SNAPSHOT.ejb3.jar,unitName=texaco
      2007-07-15 15:23:08,421 DEBUG [org.jboss.ejb3.entity.PersistenceUnitDeployment] Found persistence.xml file in EJB3 jar
      2007-07-15 15:23:08,453 INFO [org.hibernate.ejb.Version] Hibernate EntityManager 3.2.1.GA
      2007-07-15 15:23:08,484 INFO [org.hibernate.cfg.annotations.Version] Hibernate Annotations 3.2.1.GA
      2007-07-15 15:23:08,484 INFO [org.hibernate.cfg.Environment] Hibernate 3.2.3
      2007-07-15 15:23:08,500 INFO [org.hibernate.cfg.Environment] hibernate.properties not found
      2007-07-15 15:23:08,500 INFO [org.hibernate.cfg.Environment] Bytecode provider name : javassist
      2007-07-15 15:23:08,500 INFO [org.hibernate.cfg.Environment] using JDK 1.4 java.sql.Timestamp handling
      2007-07-15 15:23:08,656 DEBUG [org.hibernate.ejb.Ejb3Configuration] Processing PersistenceUnitInfo [
      name: texaco
      persistence provider classname: org.hibernate.ejb.HibernatePersistence
      classloader: org.jboss.mx.loading.UnifiedClassLoader3@72edc{ url=file:/D:/Texaco/Texaco_programmatuur/jboss-4.2.0.GA/server/default/tmp/deploy/tmp21839texaco_deploy-1.0-SNAPSHOT.ear ,addedOrder=43}
      Temporary classloader: null
      excludeUnlistedClasses: false
      JTA datasource: org.jboss.resource.adapter.jdbc.WrapperDataSource@1046270
      Non JTA datasource: null
      Transaction type: JTA
      PU root URL: file:/D:/Texaco/Texaco_programmatuur/jboss-4.2.0.GA/server/default/tmp/deploy/tmp21839texaco_deploy-1.0-SNAPSHOT.ear-contents/texaco_model-1.0-SNAPSHOT.ejb3
      Jar files URLs []
      Managed classes names [
      be.erpsystem.texaco.Article]
      Mapping files names []
      Properties [
      hibernate.jndi.java.naming.factory.url.pkgs: org.jboss.naming:org.jnp.interfaces
      hibernate.cache.provider_class: org.hibernate.cache.HashtableCacheProvider
      hibernate.jndi.java.naming.factory.initial: org.jnp.interfaces.NamingContextFactory
      hibernate.transaction.manager_lookup_class: org.hibernate.transaction.JBossTransactionManagerLookup
      hibernate.jacc.ctx.id: texaco_model-1.0-SNAPSHOT.ejb3
      hibernate.cache.region_prefix: texaco_deploy-1_0-SNAPSHOT_ear,texaco_model-1_0-SNAPSHOT_ejb3_jar,texaco
      hibernate.session_factory_name: persistence.units:ear=texaco_deploy-1.0-SNAPSHOT.ear,jar=texaco_model-1.0-SNAPSHOT.ejb3.jar,unitName=texaco
      hibernate.bytecode.use_reflection_optimizer: false
      hibernate.bytecode.provider: javassist]
      2007-07-15 15:23:08,656 DEBUG [org.hibernate.ejb.Ejb3Configuration] Detect class: true; detect hbm: true
      2007-07-15 15:23:08,656 DEBUG [org.hibernate.ejb.Ejb3Configuration] Detect class: true; detect hbm: true
      2007-07-15 15:23:08,656 INFO [org.hibernate.ejb.Ejb3Configuration] found EJB3 Entity bean: be.erpsystem.texaco.articles.Article
      2007-07-15 15:23:08,671 WARN [org.hibernate.ejb.Ejb3Configuration] Persistence provider caller does not implements the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
      2007-07-15 15:23:08,671 DEBUG [org.jboss.ejb3.ServiceDelegateWrapper] Starting failed persistence.units:ear=texaco_deploy-1.0-SNAPSHOT.ear,jar=texaco_model-1.0-SNAPSHOT.ejb3.jar,unitName=texaco
      javax.persistence.PersistenceException: [PersistenceUnit: texaco] class or package not found
      at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1089)

      In the EJB-jar file, the following persistence.xml can be found in META-INF directory:


      <persistence-unit name="texaco">
      <jta-data-source>java:TexacoDS</jta-data-source>
      be.erpsystem.texaco.Article
      </persistence-unit>


      It seams impossible to create the EntityManager. However, the datasource is correct.

      2007-07-15 15:23:08,390 DEBUG [org.jboss.system.ServiceController] starting service jboss.j2ee:service=EJB3,module=texaco_model-1.0-SNAPSHOT.ejb3
      2007-07-15 15:23:08,390 DEBUG [org.jboss.ejb3.Ejb3Module] Starting jboss.j2ee:service=EJB3,module=texaco_model-1.0-SNAPSHOT.ejb3
      2007-07-15 15:23:08,390 INFO [org.jboss.ejb3.JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.entity.PersistenceUnitDeployment
      2007-07-15 15:23:08,406 INFO [org.jboss.ejb3.JmxKernelAbstraction] installing MBean: persistence.units:ear=texaco_deploy-1.0-SNAPSHOT.ear,jar=texaco_model-1.0-SNAPSHOT.ejb3.jar,unitName=texaco with dependencies:
      2007-07-15 15:23:08,406 INFO [org.jboss.ejb3.JmxKernelAbstraction] jboss.jca:name=TexacoDS,service=DataSourceBinding

      Can anyone clarify the error-messages above, because I cannot find any relevant information on the web.

      Thanks,
      Davy

        • 1. Re: Deployment problems - persistence unit could not be crea
          Davy De Winter Newbie

          I'm sorry, I've pushed too fast on the button "submit" making an unclear post:

          the main problem is thus:

          2007-07-15 15:23:08,656 INFO [org.hibernate.ejb.Ejb3Configuration] found EJB3 Entity bean: be.erpsystem.texaco.articles.Article
          2007-07-15 15:23:08,671 WARN [org.hibernate.ejb.Ejb3Configuration] Persistence provider caller does not implements the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
          2007-07-15 15:23:08,671 DEBUG [org.jboss.ejb3.ServiceDelegateWrapper] Starting failed persistence.units:ear=texaco_deploy-1.0-SNAPSHOT.ear,jar=texaco_model-1.0-SNAPSHOT.ejb3.jar,unitName=texaco
          javax.persistence.PersistenceException: [PersistenceUnit: texaco] class or package not found
          at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1089)
          


          The persistence-unit defined in persistence.xml cannot be found. The
          following annotation in my session-bean causes the problem:

          import javax.persistence.EntityManager;
          import javax.persistence.PersistenceContext;
          
          @Stateless
          public class ArticleManager implements ArticleManagerRemote, ArticleManagerLocal {
           @PersistenceContext (unitName="texaco") EntityManager em;
          

          causing the problem.

          The persistence.xml-file is read correctly and the binding to the (MySQL) datasource works fine. The persistence.xml looks as follows:

          <persistence>
           <persistence-unit name="texaco">
           <jta-data-source>java:TexacoDS</jta-data-source>
           <class>be.erpsystem.texaco.Article</class>
           </persistence-unit>
          </persistence>
          


          Thanks again and sorry for the bad post.

          Davy.

          • 2. Re: Deployment problems - persistence unit could not be crea
            Carlo de Wolf Master

             

            "dgdwinte" wrote:
            ...
            2007-07-15 15:23:08,656 INFO [org.hibernate.ejb.Ejb3Configuration] found EJB3 Entity bean: be.erpsystem.texaco.articles.Article
            ...

            ...
            <persistence>
             <persistence-unit name="texaco">
             <jta-data-source>java:TexacoDS</jta-data-source>
             <class>be.erpsystem.texaco.Article</class>
             </persistence-unit>
            </persistence>
            


            Thanks again and sorry for the bad post.

            Davy.

            be.erpsystem.texaco.articles.Article
            Typo?

            • 3. Re: Deployment problems - persistence unit could not be crea
              ABD KOU Newbie

              HY, i have exactly the same problem (error).
              Did you find a solution, please answer me thx.

              abdgod@yahoo.fr