4 Replies Latest reply on Dec 31, 2012 6:01 AM by POORNA SAMA

    java.lang.ClassNotFoundException: org.hibernate.FlushMode

    POORNA SAMA Newbie

      Hi,

      I am trying to deploy the war file in JBOSS AS 7.1.1 application server. I am facing below exception

       

       

      19:30:59,850 DEBUG [org.jboss.modules] (MSC service thread 1-1) Module org.jboss.logging.jul-to-slf4j-stub:main defined by local module loader @15cda3f (roots: D:\jboss-as-7.1.1.Final-FO\modules)

      19:30:59,955 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."fows.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."fows.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "fows.war"

      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_21]

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_21]

      at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21]

      Caused by: java.lang.RuntimeException: Error getting reflective information for class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter with ClassLoader ModuleClassLoader for Module "deployment.fows.war:main" from Service Module Loader

      at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

      at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)

      at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:85)

      at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:70)

      at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55)

      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

      ... 5 more

      Caused by: java.lang.NoClassDefFoundError: Lorg/hibernate/FlushMode;

      at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.6.0_21]

      at java.lang.Class.privateGetDeclaredFields(Class.java:2291) [rt.jar:1.6.0_21]

      at java.lang.Class.getDeclaredFields(Class.java:1743) [rt.jar:1.6.0_21]

      at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

      at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

      ... 10 more

      Caused by: java.lang.ClassNotFoundException: org.hibernate.FlushMode from [Module "deployment.fows.war:main" from Service Module Loader]

      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

      ... 15 more

       

      I did the workaround.I am doing the build using maven.The build was successful.But the war file does n't contains FlushMode.class.Please find the screen shot for reference.

      But C:\bin\mvn\repo\org\hibernate\hibernate-core\3.3.1.GA contains hibernate-core-3.3.1.GA jar file having the FlushMode.class.Please find the screen shot for reference.

       

      I am giving more info

         We have used 1.JDK & JRE - Version 1.6

                               2.Maven - Version 2.2.0

                               3.Spring 2.5

                               4.Hibernate 3

                               5.Oracle 10g

                              

       

      I have created the war file using above technologies.I am able to deploy the war file in JBOSS 5.1.0.GA application server.I want to deploy the same war file in JBOSS AS7.1.1 application server.

       

      To deploy the same war file in JBOSS AS7.1.1

       

      i did the necesscary changes in standalone.xml,modules folder as per JBOSS AS 7.1.1 standards.

       

      Could you please help me how to resolve this exception.Your help will be appreciated.

        • 1. Re: java.lang.ClassNotFoundException: org.hibernate.FlushMode
          Tomaz Cerar Master

          how did you deploy your app?

           

          did you define that your app provides its own hibernate?

           

          see similar problem https://community.jboss.org/thread/200096

          • 2. Re: java.lang.ClassNotFoundException: org.hibernate.FlushMode
            POORNA SAMA Newbie

            Hi Tomoz,

               Here my requirement is I have to use 1).Hibernate version 3.2.2.ga 2).JBOSS AS 7.1.1

               But in your reply https://community.jboss.org/thread/200096

               In the above thread they have explained Hibernate version 3.5 or more and jboss-as-7.2.0.Alpha1-SNAPSHOT server.

               But i need how to load the org.hibernate.FlushMode.class in war file (It means my repo repository is having the org.hibernate.FlushMode.class,but the war file does not contains the org.hibernate.FlushMode.class.

             

            Could you please suggest me  compatable Jar's/workaround/fix/Solution to resolve the above exception.

             

            Technology

            Current Version

            Target Version

            IDE

            Eclipse Galileo 3.1.1

            Eclipse Indigo 3.7.2

            JDK

            1.6

            1.6

            Jboss

            5.1.0GA

            AS7.1.1 Final

            Spring

            2.5

            2.5

            Hibernate

            3.2.2GA

            3.2.2GA

            Oracle

            10g

            11g

            JSF

            1.2

            1.2

             

             

            Maven

            2.2.0

             

               Please let me know how to use tattletale tool to get the compatable jar's to do the Upgrade from Current version to TargetVersion for the above mentioned technologies.

            • 3. Re: java.lang.ClassNotFoundException: org.hibernate.FlushMode
              Nicklas Karlsson Master

              It's not that much of a tattletale-thing. When talking server-side integrated technologies like JPA (Hibernate) or classloader-heavy stuff (Spring) you're always at risk of running into version-limits or problems when running older versions on the AS.

              • 4. Re: java.lang.ClassNotFoundException: org.hibernate.FlushMode
                POORNA SAMA Newbie

                Hi Tomoz Cerar,

                    Thanks for the reply.

                 

                    I had gone through this https://community.jboss.org/thread/200096

                 

                    In my project i have created a folder 3 inside hibernate folder and i have copied the jar's inside main folder,it  contains the below files.

                  

                 

                    dom4j-1.6.1.jar,

                    hibernate3.jar,

                    hibernate-3.2.2.ga.jar,

                    hibernate-annotations.jar,

                   hibernate-tools.jar,

                   module.xml

                 

                 

                        Path :1).D:\jboss-as-7.2.0.Alpha1-SNAPSHOT\modules\org\hibernate\3\main

                 

                The module.xml contains below information

                 

                  <?xml version="1.0" encoding="UTF-8"?>

                      <module xmlns="urn:jboss:module:1.1" name="org.hibernate">
                    <resources>
                         <resource-root path="hibernate3.jar"/>      
                   <resource-root path="hibernate-annotations.jar"/>       
                   <resource-root path="hibernate-tools.jar"/>                
                   <resource-root path="dom4j-1.6.1.jar"/>         
                   <resource-root path="hibernate-3.2.2.ga.jar"/>
                  <!-- Insert resources here -->
                    </resources>

                    <dependencies>
                        <module name="org.hibernate" slot="3"/>       
                  <module name="asm.asm"/>       
                  <module name="javax.api"/>       
                  <module name="javax.persistence.api"/>       
                  <module name="javax.transaction.api"/>       
                  <module name="javax.validation.api"/>       
                  <module name="org.infinispan"/>       
                  <module name="org.javassist"/>       
                  <module name="org.slf4j"/>
                    </dependencies>
                </module>

                 

                jboss-deployment-structure.xml contains the below information


                <?xml version="1.0" encoding="UTF-8"?>
                <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
                <deployment>
                    <exclusions>
                        <module name="javax.faces.api" slot="main"/>
                        <module name="com.sun.jsf-impl" slot="main"/>   
                        <module name="org.hibernate" slot="main"/>   
                        <module name="org.hibernate.validator" slot="main" />  
                     </exclusions>
                    <dependencies>
                         <module name="org.dom4j"/>
                         <module name="org.apache.log4j"/>
                         <module name="org.apache.commons.collections"/>
                         <module name="javax.faces.api" slot="1.2"/>
                         <module name="com.sun.jsf-impl" slot="1.2"/>
                         <module name="com.agcs.cores.utilities" />
                       <module name="com.agcs.cores.fo.service" />
                       <module name="org.hibernate.3" />
                    </dependencies>
                    </deployment>

                 

                2).I have deployed the war file using jboss-as-7.2.0.Alpha1-SNAPSHOT server.

                 

                But still i am getting the below exception.

                 

                13:33:06,270 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit."fows.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."fows.war".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment "fows.war"
                        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
                        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.3.GA.jar:1.0.3.GA]
                        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.3.GA.jar:1.0.3.GA]
                        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_21]
                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_21]
                        at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21]
                Caused by: java.lang.RuntimeException: JBAS018757: Error getting reflective information for class org.springframework.orm.hibernate3.support.OpenSessionInViewFilter with ClassLoader ModuleClassLoader for Module "deployment.fows.war:main" from Service Module Loader
                        at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:72) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
                        at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)
                        at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:107)
                        at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:92)
                        at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:77)
                        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
                        ... 5 more
                Caused by: java.lang.NoClassDefFoundError: Lorg/hibernate/FlushMode;
                        at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.6.0_21]
                        at java.lang.Class.privateGetDeclaredFields(Class.java:2291) [rt.jar:1.6.0_21]
                        at java.lang.Class.getDeclaredFields(Class.java:1743) [rt.jar:1.6.0_21]
                        at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
                        at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:68) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
                        ... 10 more
                Caused by: java.lang.ClassNotFoundException: org.hibernate.FlushMode from [Module "deployment.fows.war:main" from Service Module Loader]
                        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.3.GA]
                        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.3.GA]
                        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.3.GA]
                        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.3.GA]
                        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.3.GA]
                        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.3.GA]
                        ... 15 more

                13:33:06,902 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "fows.war"
                13:33:06,917 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
                JBAS014777:   Services which failed to start:      service jboss.deployment.unit."fows.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."fows.war".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment "fows.war"

                13:33:07,040 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
                13:33:07,054 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
                13:33:07,071 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss AS 7.2.0.Alpha1-SNAPSHOT "Steropes" started (with errors) in 32628ms - Started 140 of 227 services (1 services failed or missing dependencies, 83 services are passive or on-demand)

                 

                Coould you please suggest me  compatable Jar's/workaround/fix/Solution to resolve the above exception.