8 Replies Latest reply on Jul 27, 2012 6:18 AM by Michal Ocho

    jboss 7 and deploys error  java.lang.RuntimeException: could not load entity class

    Michal Ocho Newbie

      hello i really stuck now. I try to migrate from jboss 4.2.3 to jboss as 7 and i have a lot's of bug with ClassNotFoundException, offen it's a jar file that it can't see in his WEB-INF/lib(maybe someone knows why ?) well i solve this moving deploying jar's to ear and set them as provided(maven, pom etc) but this time it's not about some jar file but about my own class which is a entity(in code mark as @Entity). Below i put Server answer from eclipse

      14:18:54,641 INFO  [org.jboss.as.server.controller] (pool-1-thread-69) Replaced deployment "dts.sar" with deployment "dts.sar"

      14:19:37,455 INFO  [org.jboss.as.server.deployment] (pool-1-thread-69) Content added at location D:\liferay-portal-6.1.0-ce-ga1\jboss-7.0.2\standalone\data\content\38\7b788ff8adfa05a9b3f54d1b7446ab23520649\content

      14:19:37,456 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Starting deployment of "dts.ear"

      14:19:38,759 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) Starting deployment of "xstream-1.1.3.jar"

      14:19:38,759 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Starting deployment of "jboss-seam-2.2.0.GA.jar"

      14:19:38,759 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "dts.jar"

      14:19:38,759 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Starting deployment of "dts.sar"

      14:19:38,760 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Starting deployment of "jcommon-1.0.16.jar"

      14:19:38,760 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "jboss-el-1.0_02.CR3.jar"

      14:19:38,760 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Starting deployment of "jboss-seam-ui-2.2.0.GA.jar"

      14:19:38,760 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "loginHook-hook.war"

      14:19:38,759 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Starting deployment of "jfreechart-1.0.13.jar"

      14:19:38,760 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Starting deployment of "jboss-seam-excel-2.2.0.GA.jar"

      14:19:38,760 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "richfaces-ui-3.3.3.Final.jar"

      14:19:38,761 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Starting deployment of "richfaces-impl-3.3.3.Final.jar"

      14:19:38,761 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "jboss-seam-pdf-2.2.0.GA.jar"

      14:19:38,761 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Starting deployment of "quartz-1.8.4.jar"

      14:19:38,761 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Starting deployment of "jboss-seam-mail-2.2.0.GA.jar"

      14:19:38,759 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) Starting deployment of "richfaces-api-3.3.3.Final.jar"

      14:19:38,760 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Starting deployment of "xpp3_min-1.1.3.4.O.jar"

      14:19:38,766 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-8) Class Path entry iText-toolbox.jar in "/D:/liferay-portal-6.1.0-ce-ga1/jboss-7.0.2/bin/content/dts.ear/itext-2.1.2.jar"  does not point to a valid jar for a Class-Path reference.

      14:19:38,766 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-8) Class Path entry iText-toolbox-2.1.2.jar in "/D:/liferay-portal-6.1.0-ce-ga1/jboss-7.0.2/bin/content/dts.ear/itext-2.1.2.jar"  does not point to a valid jar for a Class-Path reference.

      14:19:38,766 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-8) Class Path entry bcmail-jdk14-138.jar in "/D:/liferay-portal-6.1.0-ce-ga1/jboss-7.0.2/bin/content/dts.ear/itext-2.1.2.jar"  does not point to a valid jar for a Class-Path reference.

      14:19:38,766 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-8) Class Path entry bcprov-jdk14-138.jar in "/D:/liferay-portal-6.1.0-ce-ga1/jboss-7.0.2/bin/content/dts.ear/itext-2.1.2.jar"  does not point to a valid jar for a Class-Path reference.

      14:19:38,773 WARN  [org.jboss.as.server.deployment.service-loader] (MSC service thread 1-8) Encountered invalid class name "org.xmlpull.mxp1.MXParser,org.xmlpull.mxp1_serializer.MXSerializer" for service type "org.xmlpull.v1.XmlPullParserFactory"

      14:19:38,775 INFO  [org.jboss.jpa] (MSC service thread 1-8) read persistence.xml for dts

      14:19:38,776 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to dts.ear

      14:19:38,777 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added (default provider) org.hibernate dependency to application deployment (since 1 PU(s) didn't specify jboss.as.jpa.providerModule)

      14:19:38,777 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added org.hibernate dependency to application deployment

      14:19:38,778 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to jcommon-1.0.16.jar

      14:19:38,778 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to richfaces-impl-3.3.3.Final.jar

      14:19:38,779 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to loginHook-hook.war

      14:19:38,779 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to richfaces-api-3.3.3.Final.jar

      14:19:38,780 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to dts.jar

      14:19:38,780 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added (default provider) org.hibernate dependency to application deployment (since 1 PU(s) didn't specify jboss.as.jpa.providerModule)

      14:19:38,780 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added org.hibernate dependency to application deployment

      14:19:38,781 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to xpp3_min-1.1.3.4.O.jar

      14:19:38,781 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to jboss-el-1.0_02.CR3.jar

      14:19:38,781 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to quartz-1.8.4.jar

      14:19:38,782 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to jboss-seam-pdf-2.2.0.GA.jar

      14:19:38,782 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to jboss-seam-excel-2.2.0.GA.jar

      14:19:38,783 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to richfaces-ui-3.3.3.Final.jar

      14:19:38,783 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to jboss-seam-2.2.0.GA.jar

      14:19:38,784 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to dts.sar

      14:19:38,784 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to xstream-1.1.3.jar

      14:19:38,785 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to jfreechart-1.0.13.jar

      14:19:38,785 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to jboss-seam-mail-2.2.0.GA.jar

      14:19:38,786 INFO  [org.jboss.as.jpa] (MSC service thread 1-8) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to jboss-seam-ui-2.2.0.GA.jar

      14:19:38,921 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named EjbSynchronizations in deployment unit subdeployment "jboss-seam-2.2.0.GA.jar" of deployment "dts.ear" are as follows:

       

          java:global/dts/jboss-seam-2.2.0.GA/EjbSynchronizations!org.jboss.seam.transaction.LocalEjbSynchronizations

          java:app/jboss-seam-2.2.0.GA/EjbSynchronizations!org.jboss.seam.transaction.LocalEjbSynchronizations

          java:module/EjbSynchronizations!org.jboss.seam.transaction.LocalEjbSynchronizations

          java:global/dts/jboss-seam-2.2.0.GA/EjbSynchronizations

          java:app/jboss-seam-2.2.0.GA/EjbSynchronizations

          java:module/EjbSynchronizations

       

      14:19:38,921 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named TimerServiceDispatcher in deployment unit subdeployment "jboss-seam-2.2.0.GA.jar" of deployment "dts.ear" are as follows:

       

          java:global/dts/jboss-seam-2.2.0.GA/TimerServiceDispatcher!org.jboss.seam.async.LocalTimerServiceDispatcher

          java:app/jboss-seam-2.2.0.GA/TimerServiceDispatcher!org.jboss.seam.async.LocalTimerServiceDispatcher

          java:module/TimerServiceDispatcher!org.jboss.seam.async.LocalTimerServiceDispatcher

          java:global/dts/jboss-seam-2.2.0.GA/TimerServiceDispatcher

          java:app/jboss-seam-2.2.0.GA/TimerServiceDispatcher

          java:module/TimerServiceDispatcher

       

      14:19:38,927 INFO  [org.jboss.jpa] (MSC service thread 1-7) starting Persistence Unit Service 'dts.ear/dts.jar#dts'

      14:19:38,928 INFO  [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-7) HHH00204:Processing PersistenceUnitInfo [

          name: dts

          ...]

      14:19:38,930 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.persistenceunit."dts.ear/dts.jar#dts": org.jboss.msc.service.StartException in service jboss.persistenceunit."dts.ear/dts.jar#dts": Failed to start service

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1780) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_15]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_15]

          at java.lang.Thread.run(Thread.java:619) [:1.6.0_15]

      Caused by: java.lang.RuntimeException: error trying to scan <jar-file>: vfs:/D:/liferay-portal-6.1.0-ce-ga1/jboss-7.0.2/bin/content/dts.ear/dts.jar/

          at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:849)

          at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:591)

          at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)

          at org.jboss.as.jpa.service.PersistenceUnitService.createContainerEntityManagerFactory(PersistenceUnitService.java:143)

          at org.jboss.as.jpa.service.PersistenceUnitService.start(PersistenceUnitService.java:77)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

          ... 3 more

      Caused by: java.lang.RuntimeException: could not load entity class 'com.recglobal.dts.model.views.PlanSalesValue' with PersistenceUnitInfo.getNewTempClassLoader()

          at org.jboss.as.jpa.hibernate4.HibernateAnnotationScanner.getClassesInJar(HibernateAnnotationScanner.java:152)

          at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:479)

          at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:846)

          ... 9 more

      Caused by: java.lang.ClassNotFoundException: com.recglobal.dts.model.views.PlanSalesValue from [Module "deployment.dts.ear.dts.jar:main" from Service Module Loader]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191) [jboss-modules.jar:1.0.2.GA]

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361) [jboss-modules.jar:1.0.2.GA]

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310) [jboss-modules.jar:1.0.2.GA]

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103) [jboss-modules.jar:1.0.2.GA]

          at org.jboss.as.jpa.hibernate4.HibernateAnnotationScanner.getClassesInJar(HibernateAnnotationScanner.java:148)

          ... 11 more

       

      14:19:38,948 INFO  [org.jboss.web] (MSC service thread 1-8) registering web context: /loginHook

      14:19:39,154 INFO  [org.jboss.as.server.controller] (pool-1-thread-69) Deployment of "dts.ear" was rolled back with failure message {"Failed services" => {"jboss.persistenceunit.\"dts.ear/dts.jar#dts\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"dts.ear/dts.jar#dts\": Failed to start service"}}

      14:19:39,185 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Stopped deployment richfaces-impl-3.3.3.Final.jar in 30ms

      14:19:39,186 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) Stopped deployment jboss-seam-excel-2.2.0.GA.jar in 31ms

      14:19:39,186 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) Stopped deployment jboss-el-1.0_02.CR3.jar in 31ms

      14:19:39,187 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Stopped deployment jboss-seam-ui-2.2.0.GA.jar in 32ms

      14:19:39,187 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) Stopped deployment jboss-seam-2.2.0.GA.jar in 32ms

      14:19:39,186 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Stopped deployment jboss-seam-pdf-2.2.0.GA.jar in 31ms

      14:19:39,188 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Stopped deployment dts.jar in 33ms

      14:19:39,188 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) Stopped deployment richfaces-ui-3.3.3.Final.jar in 33ms

      14:19:39,188 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Stopped deployment xpp3_min-1.1.3.4.O.jar in 33ms

      14:19:39,189 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) Stopped deployment jcommon-1.0.16.jar in 34ms

      14:19:39,187 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Stopped deployment quartz-1.8.4.jar in 32ms

      14:19:39,189 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Stopped deployment richfaces-api-3.3.3.Final.jar in 34ms

      14:19:39,189 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) Stopped deployment jboss-seam-mail-2.2.0.GA.jar in 34ms

      14:19:39,190 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Stopped deployment jfreechart-1.0.13.jar in 35ms

      14:19:39,192 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) Stopped deployment xstream-1.1.3.jar in 37ms

      14:19:39,193 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) Stopped deployment dts.sar in 38ms

      14:19:39,610 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Stopped deployment loginHook-hook.war in 454ms

      14:19:39,631 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) Stopped deployment dts.ear in 476ms

       

      Of course if this class don't exist then i don't even bother you, this time i really need some advice because i can't get any help here and i am out of new ideas. I try to fix it by putting a editinh Manifest.mf but didn't work. Seriously ask what u need from me, i really need some help.

      Manifest-Version: 1.0

      Class-Path: com/recglobal/dts/model/views/PlanSalesValue.class

        • 1. Re: jboss 7 and deploys error  java.lang.RuntimeException: could not load entity class
          Frank Langelage Master

          Using JBoss AS 7.0.2 you don't have full support of the Java EE stack, only the Web Profile with EJB Lite officially supported at that time.

           

          What does your persistence.xml file look like?

          You're refencing there jar files or classes?

           

          Tell us more about your packaging: jar -tvf dts.ear.

          The missing classes are also in dts.jar like the persistence.xml file?

          • 2. Re: jboss 7 and deploys error  java.lang.RuntimeException: could not load entity class
            Michal Ocho Newbie

            META-INF/

            META-INF/MANIFEST.MF

            commons-beanutils-1.8.0.jar

            commons-collections-3.2.jar

            commons-digester-1.8.1.jar

            commons-logging-1.0.4.jar

            dts.jar

            dts.sar

            2 dts.war

            itext-2.1.2.jar

            itext-rtf-2.1.2.jar

            jboss-el-1.0_02.CR3.jar

            jboss-seam-2.2.0.GA.jar

            jboss-seam-excel-2.2.0.GA.jar

            jboss-seam-jul-2.2.0.GA.jar

            jboss-seam-mail-2.2.0.GA.jar

            jboss-seam-pdf-2.2.0.GA.jar

            jboss-seam-ui-2.2.0.GA.jar

            jcommon-1.0.16.jar

            jfreechart-1.0.13.jar

            jsf-facelets-1.1.15.B1.jar

            jta-1.1.jar

            jxl-2.6.8-seam.jar

            loginHook-hook.war

            META-INF/application.xml

            META-INF/jboss-deployment-structure.xml

            portal-client-6.1.0.jar

            quartz-1.8.4.jar

            richfaces-api-3.3.3.Final.jar

            richfaces-impl-3.3.3.Final.jar

            richfaces-ui-3.3.3.Final.jar

            slf4j-api-1.6.0.jar

            util-bridges-6.1.0.jar

            util-java-6.1.0.jar

            util-taglib-6.1.0.jar

            xpp3_min-1.1.3.4.O.jar

            xstream-1.1.3.jar

            META-INF/maven/

            META-INF/maven/com.recglobal.dts/

            META-INF/maven/com.recglobal.dts/dts-ear/

            META-INF/maven/com.recglobal.dts/dts-ear/pom.xml

            META-INF/maven/com.recglobal.dts/dts-ear/pom.properties

             

             

             

             

            persistance.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="dts">

                    <provider>org.hibernate.ejb.HibernatePersistence</provider>

                 <!--   <jta-data-source>java:/DTSDS</jta-data-source>-->

                 <jta-data-source>java:jboss/datasources/DTSDS</jta-data-source>

                    <properties>

                        <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />

                        <property name="hibernate.hbm2ddl.auto" value="${hibernate.hbm2ddl.auto}" />

                        <property name="hibernate.show_sql" value="${hibernate.show_sql}" />

                        <property name="hibernate.cache.use_query_cache" value="true" />

                        <property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider" />

                        <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />

                        <property name="jboss.entity.manager.factory.jndi.name" value="java:/dtsEntityManagerFactory" />

                    </properties>

                </persistence-unit>

            </persistence>

             

            missing class is also in dts.jar with persistance.xml

            • 3. Re: jboss 7 and deploys error  java.lang.RuntimeException: could not load entity class
              Frank Langelage Master

              Compared your persistence.xml with mine. Here my proposals:

              First I'd switch to JPA 2.0:

              <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_2_0.xsd"

                           version="2.0">

              ...

              </persistence>

               

              Specify transaction-type, don't know what's the default.

              You're specifying jta-data-source, so it mus be JTA:

              <persistence-unit name="..." transaction-type="JTA">

               

              comment out the last 3 properties as a try:

              <!--

                          <property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider" />

                          <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />

                          <property name="jboss.entity.manager.factory.jndi.name" value="java:/dtsEntityManagerFactory" />

              -->

              1 of 1 people found this helpful
              • 4. Re: jboss 7 and deploys error  java.lang.RuntimeException: could not load entity class
                Anshu Gupta Newbie

                Possible problem areas-

                1. DS not defined properly

                2. Use JTA with persistence unit name.

                3. Try to put explicitly your entity class in <class> inside persistence.xml

                4. Remove last 4 lines in persistence.xml

                 

                Also could you post your entity class?

                1 of 1 people found this helpful
                • 5. Re: jboss 7 and deploys error  java.lang.RuntimeException: could not load entity class
                  Michal Ocho Newbie

                  entity class is 100% good couse i only migrate from 4.2.3 to jboss as 7 so it must be good. I will try yours propositions tommorow (couse don't have access now) and tell you is it works.

                  • 6. Re: jboss 7 and deploys error  java.lang.RuntimeException: could not load entity class
                    Michal Ocho Newbie

                    i change my Persistance.xml to this

                    <?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 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_2_0.xsd"

                                 version="2.0">

                        <persistence-unit name="dts"  transaction-type="JTA">

                            <provider>org.hibernate.ejb.HibernatePersistence</provider>

                         <!--   <jta-data-source>java:/DTSDS</jta-data-source>-->

                         <jta-data-source>java:jboss/datasources/DTSDS</jta-data-source>

                         <class>com.recglobal.dts.model.views.PlanSalesValue</class>

                         <class>com.recglobal.dts.model.views.Obligation</class>

                         <class>com.recglobal.dts.model.entities.Commitment</class>

                        <class>com.recglobal.dts.model.entities.SalesData</class>

                        <class>com.recglobal.dts.model.entities.SalesValue</class>

                        <class>com.recglobal.dts.model.entities.DtsEntity</class>

                        <class>com.recglobal.dts.model.entities.UserActivity</class>

                        <class>com.recglobal.dts.model.entities.Competitor</class>

                        <class>com.recglobal.dts.model.entities.CompetitorPlan</class>

                        <class>com.recglobal.dts.model.entities.CriticalSuccessFactor</class>

                        <class>com.recglobal.dts.model.entities.KeyAchievement</class>

                        <class>com.recglobal.dts.model.entities.Message</class>

                        <class>com.recglobal.dts.model.entities.Milestone</class>

                        <class>com.recglobal.dts.model.entities.NecessaryCondition</class>

                        <class>com.recglobal.dts.model.entities.Obstacle</class>

                        <class>com.recglobal.dts.model.entities.OrganizationNode</class>

                        <class>com.recglobal.dts.model.entities.Plan</class>

                        <class>com.recglobal.dts.model.entities.PlanReview</class>

                        <class>com.recglobal.dts.model.entities.PlanTimeWindow</class>

                        <class>com.recglobal.dts.model.entities.ProjectEvent</class>

                        <class>com.recglobal.dts.model.entities.ReviewComment</class>

                            <properties>

                                <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />

                                <property name="hibernate.hbm2ddl.auto" value="${hibernate.hbm2ddl.auto}" />

                                <property name="hibernate.show_sql" value="${hibernate.show_sql}" />

                                <property name="hibernate.archive.autodetection" value="class, hbm"/>

                     

                                <property name="hibernate.cache.use_query_cache" value="true" />

                           <!-- <property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider" />

                                <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />

                                <property name="jboss.entity.manager.factory.jndi.name" value="java:/dtsEntityManagerFactory" /> -->

                            </properties>

                        </persistence-unit>

                    </persistence>

                     

                    I add all entity class in project for sure and still have this same issue. I try different combination of comments with last 4 property but this don't change anything, still have this same error. Is it possible that class loader simple don't see this class, i think that becouse  Caused by: java.lang.ClassNotFoundException: com.recglobal.dts.model.views.PlanSalesValue from [Module "deployment.dts.ear.dts.jar:main" from Service Module Loader] ? Maybe is there some way to show him not only  <class>com.recglobal.dts.model.views.PlanSalesValue</class> ?

                    • 7. Re: jboss 7 and deploys error  java.lang.RuntimeException: could not load entity class
                      Michal Ocho Newbie

                      I check connection with my xa-datasource java:jboss/datasources/DTSDS

                      [standalone@localhost:9999 /] /subsystem=datasources/xa-data-source=java\:jboss\

                      /datasources\/DTSDS:test-connection-in-pool

                      {

                          "outcome" => "success",

                          "result" => [true]

                      }

                      So it's ds is configured well, extras DTSDS def from standalone.xml

                      <xa-datasource jndi-name="java:jboss/datasources/DTSDS" pool-name="DTSDS" enabled="true" use-java-context="true" use-ccm="true">

                                          <xa-datasource-property name="DatabaseName">

                                              dts

                                          </xa-datasource-property>

                                          <xa-datasource-property name="User">

                                              dts

                                          </xa-datasource-property>

                                          <xa-datasource-property name="ServerName">

                                              localhost

                                          </xa-datasource-property>

                                          <xa-datasource-property name="PortNumber">

                                              5432

                                          </xa-datasource-property>

                                          <xa-datasource-property name="Password">

                                              dts

                                          </xa-datasource-property>

                                          <xa-datasource-class>

                                              org.postgresql.xa.PGXADataSource

                                          </xa-datasource-class>

                                          <driver>

                                              postgresql-8.4-701.jdbc4.jar

                                          </driver>

                                      </xa-datasource>

                      • 8. Re: jboss 7 and deploys error  java.lang.RuntimeException: could not load entity class
                        Michal Ocho Newbie

                        Everything move on after i moved dts.jar to dts.ear/lib/ so it's extremly important to keep every jars in lib