Announcement Announcement Module
Collapse
No announcement yet.
Failed to load ContextLoaderListener Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Failed to load ContextLoaderListener

    Hi everyone,

    My application is running fine under Orion App SErver.
    I'm trying to migrate to Tomcat 5.5. When starting the app, I'm getting a Context initialization failed message followed by a java.lang.IncompatibleClassChangeError: Implementing class.
    There's very few similar pb on the web and on this forum.
    I'm unable to understand what the exception means. But it for sure occurs when reading the web.xml following lines
    <listener>
    <listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
    </listener>
    The only thing I can think of is the JRE version. Tomcat 5.5 uses 1.5.0 which I've never tested before with my app. (the old trick consisting in modifying the windows register to select the default JRE doesn't seems to work anymore once Java5 installed. Anyone knows how to select it now?)

    Any idea, thought might be helpful. Thanx

    Sorry for the long stacktrace:
    12:34:22,236 INFO LocalSessionFactoryBean:477 - Building new Hibernate SessionFactory
    12:34:28,533 INFO LocalSessionFactoryBean:702 - Closing Hibernate SessionFactory
    12:34:28,626 ERROR ContextLoader:172 - Context initialization failed
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'operationComptableEngagement' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'financialService' while setting property 'financialService'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'financialService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'serviceMediator' while setting property 'serviceMediator'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'serviceMediator' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'courrierModuleCrystal' while setting property 'courrierModuleFacade'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'courrierModuleCrystal' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.IncompatibleClassChangeError: Implementing class
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'financialService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'serviceMediator' while setting property 'serviceMediator'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'serviceMediator' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'courrierModuleCrystal' while setting property 'courrierModuleFacade'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'courrierModuleCrystal' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.IncompatibleClassChangeError: Implementing class
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'serviceMediator' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Can't resolve reference to bean 'courrierModuleCrystal' while setting property 'courrierModuleFacade'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'courrierModuleCrystal' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.IncompatibleClassChangeError: Implementing class
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'courrierModuleCrystal' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.IncompatibleClassChangeError: Implementing class
    java.lang.IncompatibleClassChangeError: Implementing class
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknow n Source)
    at org.apache.catalina.loader.WebappClassLoader.findC lassInternal(WebappClassLoader.java:1626)
    at org.apache.catalina.loader.WebappClassLoader.findC lass(WebappClassLoader.java:850)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1299)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1181)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknow n Source)
    at org.apache.catalina.loader.WebappClassLoader.findC lassInternal(WebappClassLoader.java:1626)
    at org.apache.catalina.loader.WebappClassLoader.findC lass(WebappClassLoader.java:850)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1299)
    at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoader.java:1181)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.getDeclaredMethods(Unknown Source)
    at java.beans.Introspector$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.beans.Introspector.getPublicDeclaredMethods(U nknown Source)
    at java.beans.Introspector.getTargetMethodInfo(Unknow n Source)
    at java.beans.Introspector.getBeanInfo(Unknown Source)
    at java.beans.Introspector.getBeanInfo(Unknown Source)
    at org.springframework.beans.CachedIntrospectionResul ts.<init>(CachedIntrospectionResults.java:140)
    at org.springframework.beans.CachedIntrospectionResul ts.forClass(CachedIntrospectionResults.java:82)
    at org.springframework.beans.BeanWrapperImpl.setIntro spectionClass(BeanWrapperImpl.java:316)
    at org.springframework.beans.BeanWrapperImpl.setWrapp edInstance(BeanWrapperImpl.java:274)
    at org.springframework.beans.BeanWrapperImpl.setWrapp edInstance(BeanWrapperImpl.java:248)
    at org.springframework.beans.BeanWrapperImpl.<init>(B eanWrapperImpl.java:192)
    at org.springframework.beans.factory.support.Abstract BeanFactory.createBeanWrapper(AbstractBeanFactory. java:444)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:311)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:260)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:221)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:145)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.resolveReference(Abstra ctAutowireCapableBeanFactory.java:980)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.resolveValueIfNecessary (AbstractAutowireCapableBeanFactory.java:918)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:859)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:688)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:325)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:260)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:221)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:145)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.resolveReference(Abstra ctAutowireCapableBeanFactory.java:980)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.resolveValueIfNecessary (AbstractAutowireCapableBeanFactory.java:918)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:859)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:688)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:325)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:260)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:221)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:145)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.resolveReference(Abstra ctAutowireCapableBeanFactory.java:980)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.resolveValueIfNecessary (AbstractAutowireCapableBeanFactory.java:918)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:859)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:688)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:325)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:260)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:221)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:145)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:291)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:317)
    at org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:131)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:224)
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:150)
    at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 48)
    at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3637)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4073)
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:759)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:739)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:524)
    at org.apache.catalina.startup.HostConfig.deployDirec tory(HostConfig.java:909)
    at org.apache.catalina.startup.HostConfig.deployDirec tories(HostConfig.java:872)
    at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:474)
    at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:1106)
    at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:310)
    at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1019)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:718)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1011)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:440)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:450)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:683)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:537)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:271)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:409)

  • #2
    the problem doesn't come from Java5.
    Got the same error with JRE 1.4.2_07

    I'm really stuck!

    Comment


    • #3
      I think you should use a servlet and not a listener - see the javadoc for extended byorg.springframework.web.context.ContextLoaderSer vlet
      Here is a quote:
      Servlet 2.3 containers known not to work with bootstrap listeners are:

      * BEA WebLogic up to 8.1 SP2
      * IBM WebSphere 5.x
      * Oracle OC4J 9.0.3

      If you happen to work with such a server, this servlet has to be used.

      So unfortunately, the only context initialization option that is compatible with all Servlet 2.3 containers is this servlet.

      Note that a startup failure of this servlet will not stop the rest of the web application from starting, in contrast to a listener failure. This can lead to peculiar side effects if other servlets get started that depend on initialization of the root web application context.

      Comment


      • #4
        Thanx for the tip Costin.

        I might try that.
        But I'm using Tomcat, which is Servlet 2.3 & 2.4 compliant, so there shouldn't be such a problem.

        And actually I tried to run a simplified application (without all the spring beans initialization) with te same web.xml (using the listener) and Tomcat doesn't complain.

        Seems to indicate that it's the Spring beans init (I've got a bunch of them) that causes the troubles.

        Cheers,
        Jean

        Comment

        Working...
        X