0 Replies Latest reply on Mar 5, 2015 8:25 AM by Hardik Patel

    java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger() error facing on Jboss 4.0.1 SP1 server due to upgrading Hibernate from 3.2 to 4.3.8

    Hardik Patel Newbie

      Hello,

       

      While upgrading Hibernate from 3.2 to 4.3.8 , I am facing below error message which cause my jboss server (boss 4.0.1 sp1 server) is not getting up.

       

      java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;

        at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:194)

       

      Further looking into it, I observed that Hibernate refers its own Jboss logging jar file (jboss-logging-3.0.1.GA jar file) and Jboss refers jboss-common-core jar file which both have common class name "logger.class" at same package level "org.jboss.logging" which cause the above error.

       

      That seems to have problem with Jar conflict.I have tried following options to solve this issue however I don't get success.

      1) Removing 'Jboss-common-core' jar from <JBoss_home>/lib directory and adding Jboss-logging jar.However Jboss server is not getting up because Jboss-common-core jar is mandatory to run jboss server.

      2) Adding Jboss-logging in server/xxx/lib directory but it's still throwing the same exception.

      3) Implementing classloading mechanism ("jboss-web.xml") in war file in WEB-INF directory as below.

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

      <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 5.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">

      <jboss-web>

          <class-loading java2ClassLoadingCompliance="false" >

              <loader-repository>com.example:archive=Example.war<loader-repository-config>java2ParentDelegaton=false</loader-repository-config>

              </loader-repository>

          </class-loading>

      </jboss-web>

       

      4) Implementing classloading mechanism ("jboss-app.xml") in ear file in  META-INF directory.In our ear file also contains war file.

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

      <!DOCTYPE jboss-app

          PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN"

          "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">

      <jboss-app> 

        <loader-repository>

        com.example:archive=example.ear

           <loader-repository-config>

           java2ParentDelegation=false

           </loader-repository-config>

        </loader-repository>

      </jboss-app>

       

      5) By adjusting "UseJBossWebLoader" attribute to false located in server/xxx/deploy/jbossweb-tomcat50.sar/META-INF/jboss-service.xml descriptor.But it throws the same exception yet.

       

      Does any one have some idea to resolve the issue?

       

      Message was edited by: Hardik Patel