6 Replies Latest reply on Apr 13, 2007 3:26 AM by Adam

    [BUG] - Error during deployment

    Adam Newbie

      Hi
      When I deploy my ear file i have got the stacktrace:
      21:58:06,703 INFO [Ejb3Configuration] found EJB3 Entity bean: airport.bean.entity.Airplane
      21:58:06,703 INFO [Ejb3Configuration] found EJB3 Entity bean: airport.bean.entity.Airport
      21:58:06,703 INFO [Ejb3Configuration] found EJB3 Entity bean: airport.bean.entity.City
      21:58:06,703 INFO [Ejb3Configuration] found EJB3 Entity bean: airport.bean.entity.Country
      21:58:06,718 WARN [Ejb3Configuration] Persistence provider caller does not implements the EJB3 spec correctly. PersistenceU
      nitInfo.getNewTempClassLoader() is null.
      21:58:06,718 WARN [ServiceController] Problem starting service persistence.units:ear=mgr.ear,unitName=airportPU
      javax.persistence.PersistenceException: [PersistenceUnit: airportPU] class or package not found
      at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1067)
      at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:864)
      at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:750)
      at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:385)
      at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)
      at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:102)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy76.start(Unknown Source)
      at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:96)
      at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:467)
      at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:317)
      at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy29.start(Unknown Source)
      at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:449)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
      at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
      at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
      at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188
      )
      at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy30.start(Unknown Source)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy8.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
      Caused by: java.lang.ClassNotFoundException: Unexpected error during load of: airport.bean.entity.Airplane, msg=Bad version
      number in .class file
      at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:550)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:242)
      at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:112)
      at org.hibernate.ejb.Ejb3Configuration.classForName(Ejb3Configuration.java:983)
      at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1055)
      ... 102 more
      Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(RepositoryClassLoader.java:672)
      at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:652)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:190)
      at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:131)
      at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMgr3.java:399)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:517)
      ... 110 more
      21:58:06,921 INFO [EJB3Deployer] Deployed: file:/C:/jboss4/server/default/tmp/deploy/tmp4815mgr.ear-contents/mgrEJB.jar
      21:58:06,921 INFO [EARDeployer] Started J2EE application: file:/C:/jboss4/server/default/deploy/mgr.ear
      21:58:06,937 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

      --- MBeans waiting for other MBeans ---
      ObjectName: persistence.units:ear=mgr.ear,unitName=airportPU
      State: FAILED
      Reason: javax.persistence.PersistenceException: [PersistenceUnit: airportPU] class or package not found
      I Depend On:
      jboss.jca:service=DataSourceBinding,name=OracleDS

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: persistence.units:ear=mgr.ear,unitName=airportPU
      State: FAILED
      Reason: javax.persistence.PersistenceException: [PersistenceUnit: airportPU] class or package not found
      I Depend On:
      jboss.jca:service=DataSourceBinding,name=OracleDS


      Here's my persistence.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
      version="1.0">
      <persistence-unit name="airportPU" transaction-type="JTA">
      org.hibernate.ejb.HibernatePersistence
      <jta-data-source>java:/OracleDS</jta-data-source>
      airport.bean.entity.Airplane
      airport.bean.entity.Airport
      airport.bean.entity.City
      airport.bean.entity.Country





      </persistence-unit>


      Elements make no difference.
      The example entity:
      package airport.bean.entity;

      import java.io.Serializable;
      import java.util.List;

      import javax.persistence.Column;
      import javax.persistence.Entity;
      import javax.persistence.GeneratedValue;
      import javax.persistence.GenerationType;
      import javax.persistence.Id;
      import javax.persistence.OneToMany;
      import javax.persistence.SequenceGenerator;
      import javax.persistence.Table;


      @Entity
      @Table(name="COUNTRY")
      @SequenceGenerator(name="COUNTRY_SEQ", sequenceName="COUNTRY_SEQ")
      public class Country implements Serializable {

      private static final long serialVersionUID = -7185023353036470754L;

      private int id;
      private String name;
      private List cities;

      @Id
      @Column(name="id")
      @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="COUNTRY_SEQ")
      public int getId() {
      return id;
      }

      public void setId(int id) {
      this.id = id;
      }

      @Column(name="NAME", length=255, nullable=false)
      public String getName() {
      return name;
      }

      public void setName(String name) {
      this.name = name;
      }

      @OneToMany(mappedBy="country")
      public List getCities() {
      return cities;
      }

      public void setCities(List cities) {
      this.cities = cities;
      }


      }

      I've noticed that when I change import from javax.persistence.Entity to org.hibernate.annotations.Entity deployment is successfull but no tables are generated and the solution isn't JPA compliant (you have to import hibernate specific classes). I have found on jboss forum that this exception occur when use orm.xml and not specified mappings, but I DON'T use orm.xml.
      What can I do?
      I use EJB 3.0 Preview RC9 Patch 1- FD. With earlier versions it was ok.

      Regards
      Adam

        • 1. Re: [BUG] - Error during deployment
          fhh Expert

           

          <?xml version="1.0" encoding="UTF-8"?>
          <persistence xmlns="http://java.sun.com/xml/ns/persistence"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
          version="1.0">
          <persistence-unit name="airportPU" transaction-type="JTA">
          org.hibernate.ejb.HibernatePersistence
          <jta-data-source>java:/OracleDS</jta-data-source>
          airport.bean.entity.Airplane
          airport.bean.entity.Airport
          airport.bean.entity.City
          airport.bean.entity.Country
          
          
          
          
          
          </persistence-unit>
          
          


          This is a mess! Is this what you have in the file or was it just the froum formatting?

          Regards

          Felix

          • 2. Re: [BUG] - Error during deployment
            Adam Newbie

            It's formatting issue..
            There should be elements, but without them the result is the same.

            Regards
            Adam

            • 3. Re: [BUG] - Error during deployment
              fhh Expert

              Can you post your version? For example your root element is not closed and that does not look like a formatting issue to me.

              Regards

              Felix

              • 4. Re: [BUG] - Error during deployment
                Adam Newbie

                 

                <?xml version="1.0" encoding="UTF-8"?>
                <persistence xmlns="http://java.sun.com/xml/ns/persistence"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
                 version="1.0">
                 <persistence-unit name="airportPU" transaction-type="JTA">
                 <provider>org.hibernate.ejb.HibernatePersistence</provider>
                 <jta-data-source>java:/OracleDS</jta-data-source>
                 <properties>
                 <property name="hibernate.hbm2ddl.auto" value="create-drop" />
                 <property name="show_sql" value="true"/>
                 <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect" />
                 </properties>
                 </persistence-unit>
                </persistence>
                


                the code above gives the same exception as the one below

                <?xml version="1.0" encoding="UTF-8"?>
                <persistence xmlns="http://java.sun.com/xml/ns/persistence"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
                 version="1.0">
                 <persistence-unit name="airportPU" transaction-type="JTA">
                 <provider>org.hibernate.ejb.HibernatePersistence</provider>
                 <jta-data-source>java:/OracleDS</jta-data-source>
                 <class>airport.bean.entity.Airplane</class>
                 <class>airport.bean.entity.Airport</class>
                 <class>airport.bean.entity.City</class>
                 <class>airport.bean.entity.Country</class>
                 <properties>
                 <property name="hibernate.hbm2ddl.auto" value="create-drop" />
                 <property name="show_sql" value="true"/>
                 <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect" />
                 </properties>
                 </persistence-unit>
                </persistence>
                


                • 5. Re: [BUG] - Error during deployment
                  fhh Expert

                  Your persitence.xml looks good but have you seen this in your stack trace?

                  Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file
                  


                  Looks like you are using an older JDK for running the stuff than compiling it.

                  Regards

                  Felix

                  • 6. Re: [BUG] - Error during deployment
                    Adam Newbie

                    I build it with eclipse where java version is 5.0.
                    Like I said earlier when I change import from javax.persistence.Entity to org.hibernate.annotations.Entity then deploy is successfull but no tables are generated in db.

                    Regards
                    Adam