2015-01-15 58 views
0

我無法部署簡單的Hello World Example * .war。 Wildfly不會找到hibernate Session類嗎? 我的項目是使用gradle設置的(請參閱build.gradle附件)。使用wildfly 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+" 
    } 

回答