目前正在尝试在Jboss EAP 6.4上构建部署应用程序但是出现以下错误。
var x_out SYS_REFCURSOR
EXEC mySchema.myPkg.myProcedure('NV', 401334, :x_out)
print :x_out
我有以下依赖项,我认为会使用jboss模块中内置的hibernate。我有什么遗漏或做错了吗?
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
答案 0 :(得分:1)
您有三种选择:
在WEB-INF文件夹中添加 jboss-deployment-structure.xml 文件,其中包含 org.hibernate 模块依赖,如下所示:
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.hibernate" />
</dependencies>
</deployment>
</jboss-deployment-structure>
在您的pom文件中,使用此配置添加以下插件,以便maven在MANIFEST.MF文件中添加上述依赖项:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Dependencies>org.hibernate</Dependencies>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>