1 Reply Latest reply on Jan 15, 2015 7:47 AM by Tomaz Cerar

    Deployment issue with gradle and hibernate

    Moritz Winterberg Newbie

      Hi,

       

      I can't deploy my simple Hello World Example *.war. Wildfly will not find hibernate Session classes ?

      My project ist setup using gradle (see build.gradle attached).

       

      I can not find any explicit documentation on how gradle should be used in conjunction with Wildfly provided libs in general.

      Any hint is welcome.

       

      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

       

      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+"
         }