當前正試圖在Jboss EAP 6.4上構建應用程序的部署,但出現以下錯誤。使用提供的hibernate-core時未找到類
Caused by: java.lang.NoClassDefFoundError: Lorg/hibernate/Session;
at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.8.0_66]
at java.lang.Class.privateGetDeclaredFields(Class.java:2583) [rt.jar:1.8.0_66]
at java.lang.Class.getDeclaredFields(Class.java:1916) [rt.jar:1.8.0_66]
at org.jboss.seam.Component.initMembers(Component.java:560) [jboss-seam-2.3.1.Final.jar:2.3.1.Final]
at org.jboss.seam.Component.<init>(Component.java:244) [jboss-seam-2.3.1.Final.jar:2.3.1.Final]
at org.jboss.seam.Component.<init>(Component.java:205) [jboss-seam-2.3.1.Final.jar:2.3.1.Final]
at org.jboss.seam.init.Initialization.addComponent(Initialization.java:1255) [jboss-seam-2.3.1.Final.jar:2.3.1.Final]
... 14 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.Session from [Module "deployment.test.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.6.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.6.Final-redhat-1]
... 21 more
我有以下依賴關係,我認爲會使用內置到jboss模塊中的休眠。有什麼我失蹤或做錯了嗎?
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.2.Final-redhat-2</version>
<scope>provided</scope>
</dependency>
您是否嘗試過將模塊依賴添加到'jboss-deployment-structure.xml'或您的'MANIFEST.MF'中? –