3 Replies Latest reply on Jan 8, 2015 9:19 AM by jngerbaux

    Exception during Migration from Tomcat to Jboss Web

    mikemike

      Hi

       

      I have tried migrating an application (war-file) that runs very well on Apache Tomact 7 to Jboss Web 2.1.9. During startup I run in followoing exception:

       

      ERROR [ContextLoader] [] - Context initialization failed

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistenceExceptionTranslationPostProcessor' defined in class path resource [de/kkk/xxx/config/PersistenceHibernateConfig.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [de/kkk/xxx/config/PersistenceHibernateConfig.class]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)

          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)

          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)

          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

          at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:734)

          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:457)

          at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:388)

          at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:293)

          at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)

          at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)

          at org.apache.catalina.core.StandardContext.start(StandardContext.java:4389)

          at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:800)

          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:780)

          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)

          at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:904)

          at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:742)

          at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:501)

          at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1263)

          at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:322)

          at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)

          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1064)

          at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)

          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1056)

          at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)

          at org.apache.catalina.core.StandardService.start(StandardService.java:523)

          at org.apache.catalina.core.StandardServer.start(StandardServer.java:736)

          at org.apache.catalina.startup.Catalina.start(Catalina.java:575)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)

          at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [de/kkk/xxx/config/PersistenceHibernateConfig.class]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)

          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)

          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)

          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)

          at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:420)

          at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:277)

          at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:139)

          at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.<init>(PersistenceExceptionTranslationInterceptor.java:79)

          at org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.<init>(PersistenceExceptionTranslationAdvisor.java:70)

          at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:103)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1475)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1443)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)

          ... 34 more

      Caused by: 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:176)

          at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:277)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)

          ... 49 more

       

       

      Has anybody experiences with this kind of migrations? Is my idear Right that everything that is running on Tomcat should run on Jboss Web as well? How can fight tis logging problem?

       

      Ok enough questions at once..Thanks for anwering.