Wildfly 8.2.1 Final JPA 2.1
alex1985 Aug 12, 2015 10:46 AMHello,
we are currently trying to migrate from JBoss 5.1.0 to Wildfly 8.2.1. We tryed to use the bundled Hibernate 4.3.7.Final (JPA 2.1) but we have the problem (class is mapped more than once) which was referenced here [HHH-8775] Exception when mapping a class more than once - Hibernate JIRA.
So we tryed to use Hibernate 4.2.19(JPA 2.0). Therefore we added the following libs into modules\system\layers\base\org\hibernate\4.1 with the following module.xml
<!-- Represents the Hibernate 4.1.x (works with Hibernate 4.2.x jars also) module --> <module xmlns="urn:jboss:module:1.3" name="org.hibernate" slot="4.1"> <resources> <resource-root path="hibernate-core-4.2.19.Final.jar"/> <resource-root path="hibernate-envers-4.2.19.Final.jar"/> <resource-root path="hibernate-entitymanager-4.2.19.Final.jar"/> <resource-root path="hibernate-infinispan-4.2.19.Final.jar"/> <resource-root path="jipijapa-hibernate4-1-1.0.1.Final.jar"/> </resources> <dependencies> <module name="asm.asm"/> <module name="javax.api"/> <module name="javax.annotation.api"/> <module name="javax.enterprise.api"/> <module name="javax.persistence.api"/> <module name="javax.transaction.api"/> <module name="javax.validation.api"/> <module name="javax.xml.bind.api"/> <module name="org.antlr"/> <module name="org.apache.commons.collections"/> <module name="org.dom4j"/> <module name="org.infinispan" services="import"/> <module name="org.javassist"/> <module name="org.jboss.as.jpa.spi"/> <module name="org.jboss.jandex"/> <module name="org.jboss.logging"/> <module name="org.jboss.vfs"/> <module name="org.hibernate.commons-annotations"/> </dependencies> </module>
Our persistence.xml looks like this:
<?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" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> <persistence-unit name="rsPU"> <!-- JPA 2.0 --> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>java:jboss/datasources/FESAD_DS</jta-data-source> <jar-file>fesadCatalogingInterfaces.jar</jar-file> <jar-file>fesadDictionaryInterfaces.jar</jar-file> <jar-file>fesadDossierInterfaces.jar</jar-file> <jar-file>fesadMacroInterfaces.jar</jar-file> <jar-file>fesadMasterdataInterfaces.jar</jar-file> <jar-file>fesadOrderprocessingInterfaces.jar</jar-file> <jar-file>fesadPreviewInterfaces.jar</jar-file> <jar-file>fesadRetrievalInterfaces.jar</jar-file> <jar-file>fesadUserInterfaces.jar</jar-file> <jar-file>fesadGlobalInternalInterfaces.jar</jar-file> <jar-file>../fesadNormDBValueImpl.jar</jar-file> <properties> <property name="jboss.as.jpa.providerModule" value="org.hibernate:4.1" /> <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/> <property name="javax.persistence.jdbc.driver" value="com.jdbc.driver.OracleDriver"/> <property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver"/> <property name="hibernate.show_sql" value="false"/> <property name="hibernate.max_fetch_depth" value="5"/> <property name="hibernate.jdbc.batch_size" value="100"/> <property name="hibernate.jdbc.batch_versioned_data" value="false"/> <property name="hibernate.jdbc.use_get_generated_keys" value="true"/> <property name="hibernate.use_sql_comments" value="false"/> <property name="hibernate.ScanForMappingsEnabled" value="true"/> <property name="hibernate.generate_statistics" value="false"/> <property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/> <property name="hibernate.bytecode.use_reflection_optimizer" value="true"/> <property name="jboss.entity.manager.jndi.name" value="java:/rsPU"/> <property name="jboss.entity.manager.factory.jndi.name" value="java:/rsPUEntityManagerFactory"/> <property name="hibernate.jdbc.use_streams_for_binary" value="true"/> <property name="hibernate.cache.use_second_level_cache" value="true"/> <property name="hibernate.cache.use_query_cache" value="true"/> <property name="hibernate.cache.use_structured_entries" value="false"/> <property name="hibernate.cache.use_minimal_puts" value="true"/> <property name="hibernate.cache.region_prefix" value="rsPU"/> </properties> </persistence-unit> </persistence>
On Server startup we get the following error:
16:24:56,897 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 63) MSC000001: Failed to start service jboss.persistenceunit."200_fesadbean.ear#rsPU": org.jboss.msc.service.StartException in service jboss.persistenceunit."200_fesadbean.ear#rsPU": org.hibernate.annotations.common.reflection.ClassLoadingException: Unable to load Class [de.ard.sad.fesad.cataloging.docUnit.interfaces.package-info] at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172) [wildfly-jpa-8.2.1.Final.jar:8.2.1.Final] at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) [wildfly-jpa-8.2.1.Final.jar:8.2.1.Final] at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_75] at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:474) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182) [wildfly-jpa-8.2.1.Final.jar:8.2.1.Final] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_75] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_75] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_75] at org.jboss.threads.JBossThread.run(JBossThread.java:122) Caused by: org.hibernate.annotations.common.reflection.ClassLoadingException: Unable to load Class [de.ard.sad.fesad.cataloging.docUnit.interfaces.package-info] at org.hibernate.annotations.common.util.StandardClassLoaderDelegateImpl.classForName(StandardClassLoaderDelegateImpl.java:60) [hibernate-commons-annotations-4.0.4.Final.jar:4.0.4.Final] at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.packageForName(JavaReflectionManager.java:147) [hibernate-commons-annotations-4.0.4.Final.jar:4.0.4.Final] at org.hibernate.cfg.AnnotationBinder.bindPackage(AnnotationBinder.java:260) [hibernate-core-4.2.19.Final.jar:4.2.19.Final] at org.hibernate.cfg.Configuration.addPackage(Configuration.java:788) [hibernate-core-4.2.19.Final.jar:4.2.19.Final] at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:1236) [hibernate-entitymanager-4.2.19.Final.jar:4.2.19.Final] at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1058) [hibernate-entitymanager-4.2.19.Final.jar:4.2.19.Final] at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:703) [hibernate-entitymanager-4.2.19.Final.jar:4.2.19.Final] at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:75) [hibernate-entitymanager-4.2.19.Final.jar:4.2.19.Final] at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:318) [wildfly-jpa-8.2.1.Final.jar:8.2.1.Final] at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$1100(PersistenceUnitServiceImpl.java:67) [wildfly-jpa-8.2.1.Final.jar:8.2.1.Final] at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:167) [wildfly-jpa-8.2.1.Final.jar:8.2.1.Final] ... 8 more Caused by: java.lang.ClassNotFoundException: de.ard.sad.fesad.cataloging.docUnit.interfaces.package-info from [Module "org.hibernate.commons-annotations:main" from local module loader @192328ef (finder: local module finder @53546fcd (roots: C:\dev\server\wildfly-8.2.1.Final\modules,C:\dev\server\wildfly-8.2.1.Final\modules\system\layers\base))] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final] at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_75] at java.lang.Class.forName(Class.java:274) [rt.jar:1.7.0_75] at org.hibernate.annotations.common.util.StandardClassLoaderDelegateImpl.classForName(StandardClassLoaderDelegateImpl.java:57) [hibernate-commons-annotations-4.0.4.Final.jar:4.0.4.Final] ... 18 more
Any ideas to solve this problem? May we configured anything wrong with the hibernate 4.1 slot?