Announcement Announcement Module
Collapse
No announcement yet.
random spring-orm Context Initialization failure Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • random spring-orm Context Initialization failure

    Hello everyone,
    On deploying a module developed in the spring framework 2.5.5 I get an initialization error.
    Code:
    SEVERE: Context initialization failed
    org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [org.springframework.orm.hibernate3.
    LocalSessionFactoryBean] for bean with name 'sprSessionfactory' defined in ServletContext resource [/WEB-INF/conf/applic
    ationContext.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/s
    pringframework/beans/factory/BeanClassLoaderAware
            at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1141)
    
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowire
    CapableBeanFactory.java:524)
            at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1174)
            at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:754)
            at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListable
    BeanFactory.java:422)
            at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplic
    ationContext.java:729)
            at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
            at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
            at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
            at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
            at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
            at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
            at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
            at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
            at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
            at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
            at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:563)
            at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1399)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
            at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
            at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
            at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1500)
            at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:849)
            at org.apache.catalina.manager.HTMLManagerServlet.deployInternal(HTMLManagerServlet.java:287)
            at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:118)
            at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:166)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:186)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
            at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.NoClassDefFoundError: org/springframework/beans/factory/BeanClassLoaderAware
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
            at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
            at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:296)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1595)
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
            at org.springframework.util.ClassUtils.forName(ClassUtils.java:242)
            at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java
    :383)
            at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1135)
    
            ... 47 more
    Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.BeanClassLoaderAware
            at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
            at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
            ... 65 more
    22/06/2012 03:52:18 PM org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Error listenerStart
    22/06/2012 03:52:18 PM org.apache.catalina.core.StandardContext start
    SEVERE: Fallū en arranque del Contexto [/emisores] debido a errores previos
    The weird thing is that I know the path shown in the error is from a library called "spring-orm.jar". Library which I copied in many locations such as:
    • in the JRE \1.6.0\lib\ext
    • CATALINA_HOME\lib
    • inside the WEB-INF\lib folder of the module
    Still is showing me this error. The error also refers to a "sprSessionfactory" which is a tag defined in a .xml file inside the module.
    This module is not new, in fact is a compiled .war taken from source code from production environment!
    I would appreciate any suggestions and help.

  • #2
    Have you actually READ the stack trace... Also don't call the libraries everywhere as that will lead to all sorts of class loading errors. The actual missing class is BeanClassLoaderAware which is part of spring-beans...

    I suggest you use maven or gradle to manage your dependencies.

    Comment


    • #3
      Thank you for your answer Marten. You know my boss got a local copy of the portal running on his windows xp machine. It didnt show any error nor problem. I installed all the software(tibco portal builder, tomcat, databases, etc) in a windows 7 professional 64 bits machine. Do you think that would affect somehow? you know like incompatibilities?

      Comment


      • #4
        No.. As stated there is a missing jar file (as there is a classnotfoundexception). The reasoning works on his (or my ) machine is the worst reasons why something should work (IMHO that is).

        Comment

        Working...
        X