gpt4 book ai didi

hibernate - 部署因Wildfly Gradle和Hibernate而失败

转载 作者:行者123 更新时间:2023-12-03 05:16:26 32 4
gpt4 key购买 nike

我无法部署简单的Hello World示例* .war。 Wildfly是否不会找到休眠Session类?
我的项目使用gradle进行设置(请参阅附加的build.gradle)。

我找不到任何关于应如何将gradle与Wildfly提供的库一起使用的任何明确文档。
任何提示都欢迎。

Wildfly日志:

 Caused by: java.lang.ClassNotFoundException: org.hibernate.Session from [Module "deployment.myshop-1.0.war:main" from Service Module Loader]
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]
... 15 more


[0m [31m13:05:02,682 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 2) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "myshop-1.0.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"myshop-1.0.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"myshop-1.0.war\".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment \"myshop-1.0.war\"
Caused by: java.lang.RuntimeException: JBAS018757: Error getting reflective information for class com.mycorp.common.dao.HelloDao with ClassLoader ModuleClassLoader for Module \"deployment.myshop-1.0.war:main\" from Service Module Loader
Caused by: java.lang.NoClassDefFoundError: Lorg/hibernate/Session;
Caused by: java.lang.ClassNotFoundException: org.hibernate.Session from [Module \"deployment.myshop-1.0.war:main\" from Service Module Loader]"}}
[0m [31m13:05:02,683 ERROR [org.jboss.as.server] (management-handler-thread - 2) JBAS015870: Deploy of deployment "myshop-1.0.war" was rolled back with the following failure message:
{"JBAS014671: Failed services" => {"jboss.deployment.unit.\"myshop-1.0.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"myshop-1.0.war\".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment \"myshop-1.0.war\"
Caused by: java.lang.RuntimeException: JBAS018757: Error getting reflective information for class com.mycorp.common.dao.HelloDao with ClassLoader ModuleClassLoader for Module \"deployment.myshop-1.0.war:main\" from Service Module Loader
Caused by: java.lang.NoClassDefFoundError: Lorg/hibernate/Session;
Caused by: java.lang.ClassNotFoundException: org.hibernate.Session from [Module \"deployment.myshop-1.0.war:main\" from Service Module Loader]"}}
[0m [0m13:05:02,685 INFO [org.jboss.as.server.deployment] (MSC service thread 1-14) JBAS015877: Stopped deployment myshop-1.0.war (runtime-name: myshop-1.0.war) in 2ms
[0m [0m13:05:02,686 INFO [org.jboss.as.controller] (management-handler-thread - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."myshop-1.0.war".POST_MODULE

build.gradle:
version = '1.0'

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'war'

sourceCompatibility = 1.8
targetCompatibility = 1.8


repositories {
mavenLocal()
maven {
url 'http://repository.jboss.org/nexus/content/groups/public'
}
mavenCentral()
}

dependencies {

providedCompile "javax.validation:validation-api:1+"

providedCompile "org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_1.1_spec:1+"
providedCompile "org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec:1+"
providedCompile "org.jboss.resteasy:resteasy-jaxrs:3+"

providedCompile "org.hibernate:hibernate-core:4+"
providedCompile "org.hibernate:hibernate-entitymanager:4+"
providedCompile "org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1+"

providedCompile "postgresql:postgresql:9+"
/*providedCompile "postgresql:postgresql:9.1-901.jdbc4"*/

testCompile group: 'junit', name: 'junit', version: '4.11'
testCompile "org.hamcrest:hamcrest-all:1+"
testCompile "org.mockito:mockito-core:1+"
}

最佳答案

我的问题在wildfly论坛中得到了回答

https://developer.jboss.org/thread/251633

关于hibernate - 部署因Wildfly Gradle和Hibernate而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27963424/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com