3 Replies Latest reply on Feb 20, 2012 1:09 PM by Vaibhav N

    java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger on jboss-5.1.0.GA

    Vaibhav N Newbie

      Hi,

       

      I am migrating from "Jboss-4.2.3.GA" to "jboss-5.1.0.GA" version, also I have upgraded hibernate as "hibernate 4.0.1" and spring as "spring 3.1.0".

       

      "jboss-logging-3.1.0.CR2.jar" file is added for "Hibernate 4.0.1" which has BaseLogger,Logger etc class files.

      I guess, the "org.jboss.logging.Logger" of "jboss-logging-3.1.0.CR2.jar"(JBOSS_HOME\server\default\lib) file is conflicating with some other Logger class.

      It might be conflicating with "org.jboss.logging.Logger" class file of "jboss-logging-spi.jar"(JBOSS_HOME\lib).

       

      I am getting follwoing error at server startup:

      01:44:08,624 ERROR [AbstractKernelController] Error installing to Start: name=jboss.jca:service=Hibernate state=Create mode=Manual requiredState=Installed

      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:173)

          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

          at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

          at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)

          at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:104)

          at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newConfiguration(LocalSessionFactoryBean.java:818)

          at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:549)

          at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)

      ..............................

       

      I would like run hibernate as service so I have created JBOSS_HOME\server\default\deploy\z-webapp-hibernate.sar file.

      I have tried by modying "jboss-service.xml" also, it looks like:

       

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

      <server>

         <loader-repository>

            org.jboss.logging:sar=z-webapp-hibernate.sar

            <loader-repository-config>

               java2ParentDelegation=false

            </loader-repository-config>

         </loader-repository>

          <mbean code="webapp.service.hibernate.mbean.HibernateService" name="jboss.jca:service=Hibernate">       

              <attrbiute name="Configuration">hibernate-spring.xml</attrbiute>

          </mbean>

      </server>

       

      If anyone has any idea I would highly appreciate it.

       

      thanks.