Getting ClassNotFoundException while defining entity jar inside jar with persistence.xml
Issue
-
I want to deploy a
JPA 2.0 conform Jar, with a single library (JAR) and apersistence.xml. A libraryJARcontains all necessary classes for accessing dedicated tables, for several projects. -
The
persistence.xml, with the database connection Meta data, should be different for each project. So the using projects only have to change the persistence.xml. -
Following is the directory structure.
------- JPA JAR structure -------
myJPA.jar
|
|- META-INF
| |
| |- persistence.xml
|
|- myEntityClasses.jar
------------------------------------
- After deploying such a JAR, following error has been thrown:
Caused by: java.lang.ClassNotFoundException: org.common.propertyservice.util.properties.implementation.PropertyMapEntry from [Module "org.hibernate:main" from local module loader @491cc5c9 (finder: local module finder @74ad1f1f (roots: \root\home\NotBackedUp\AppServer\standalone\SBT-EAP-6.3\modules,\root\home\NotBackedUp\AppServer\standalone\SBT-EAP-6.3\modules\system\layers\base\.overlays\BZ1195283,\root\home\NotBackedUp\AppServer\standalone\SBT-EAP-6.3\modules\system\layers\base\.overlays\layer-base-jboss-eap-6.3.3.CP,\root\home\NotBackedUp\AppServer\standalone\SBT-EAP-6.3\modules\system\layers\base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.5.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.5.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.5.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.5.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.5.Final-redhat-1]
at java.lang.Class.forName0(Native Method) [rt.jar:1.8.0_25]
at java.lang.Class.forName(Unknown Source) [rt.jar:1.8.0_25]
at org.hibernate.internal.util.ReflectHelper.classForName(ReflectHelper.java:170)
at org.hibernate.ejb.Ejb3Configuration.classForName(Ejb3Configuration.java:1348)
at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1420)
Environment
- Red Hat JBoss Enterprise Application Platform
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.