Announcement Announcement Module
Collapse
No announcement yet.
Context initialization failed Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Context initialization failed

    I am using Spring + Hibernate + Oracle + JBoss

    And my session factory is like...

    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="dataSource"><ref local="dataSource"/></property>
    <property name="mappingResources">
    <list>
    <value>hibernate/Company.hbm.xml</value>
    </list>
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">org.hibernate.dialect.Orac leDialect</prop>
    <prop key="hibernate.show_sql">true</prop>
    <prop key="hibernate.generate_statistics">true</prop>
    </props>
    </property>
    </bean>


    when deploy my war, jboss is giving the following exception

    22:15:47,484 ERROR [ContextLoader] Context initialization failed
    java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlBeanDefin itionReader.setResourceLoader(Lorg/springframework/core/io/ResourceLoaderV
    at org.springframework.web.context.support.XmlWebAppl icationContext.loadBeanDefinitions(XmlWebApplicati onContext.java:81)
    at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:87)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:267)
    at org.springframework.web.context.support.AbstractRe freshableWebApplicationContext.refresh(AbstractRef reshableWebApplicationContext.java:134)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:230)
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:156)
    at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 48)
    at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3271)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:3613)
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:821)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:807)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:595)
    at org.jboss.web.tomcat.tc4.EmbeddedTomcatService.cre ateWebContext(EmbeddedTomcatService.java:549)
    at org.jboss.web.tomcat.tc4.EmbeddedTomcatService.per formDeploy(EmbeddedTomcatService.java:309)
    at org.jboss.web.AbstractWebContainer.start(AbstractW ebContainer.java:428)
    at org.jboss.deployment.MainDeployer.start(MainDeploy er.java:832)
    at org.jboss.deployment.MainDeployer.start(MainDeploy er.java:824)
    at org.jboss.deployment.MainDeployer.deploy(MainDeplo yer.java:642)
    at org.jboss.deployment.MainDeployer.deploy(MainDeplo yer.java:605)
    at sun.reflect.GeneratedMethodAccessor19.invoke(Unkno wn Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.capability.ReflectedMBeanDispatcher.i nvoke(ReflectedMBeanDispatcher.java:284)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanSe rverImpl.java:546)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyE xt.java:177)
    at $Proxy6.deploy(Unknown Source)
    at org.jboss.deployment.scanner.URLDeploymentScanner. deploy(URLDeploymentScanner.java:302)
    at org.jboss.deployment.scanner.URLDeploymentScanner. scan(URLDeploymentScanner.java:476)
    at org.jboss.deployment.scanner.AbstractDeploymentSca nner$ScannerThread.doScan(AbstractDeploymentScanne r.java:201)
    at org.jboss.deployment.scanner.AbstractDeploymentSca nner.startService(AbstractDeploymentScanner.java:2 74)
    at org.jboss.system.ServiceMBeanSupport.start(Service MBeanSupport.java:192)
    at sun.reflect.GeneratedMethodAccessor5.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.capability.ReflectedMBeanDispatcher.i nvoke(ReflectedMBeanDispatcher.java:284)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanSe rverImpl.java:546)
    at org.jboss.system.ServiceController$ServiceProxy.in voke(ServiceController.java:976)
    at $Proxy0.start(Unknown Source)
    at org.jboss.system.ServiceController.start(ServiceCo ntroller.java:394)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.capability.ReflectedMBeanDispatcher.i nvoke(ReflectedMBeanDispatcher.java:284)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanSe rverImpl.java:546)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyE xt.java:177)
    at $Proxy4.start(Unknown Source)
    at org.jboss.deployment.SARDeployer.start(SARDeployer .java:226)
    at org.jboss.deployment.MainDeployer.start(MainDeploy er.java:832)
    at org.jboss.deployment.MainDeployer.deploy(MainDeplo yer.java:642)
    at org.jboss.deployment.MainDeployer.deploy(MainDeplo yer.java:605)
    at org.jboss.deployment.MainDeployer.deploy(MainDeplo yer.java:589)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.capability.ReflectedMBeanDispatcher.i nvoke(ReflectedMBeanDispatcher.java:284)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanSe rverImpl.java:546)
    at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyE xt.java:177)
    at $Proxy5.deploy(Unknown Source)
    at org.jboss.system.server.ServerImpl.doStart(ServerI mpl.java:384)
    at org.jboss.system.server.ServerImpl.start(ServerImp l.java:291)
    at org.jboss.Main.boot(Main.java:150)
    at org.jboss.Main$1.run(Main.java:395)
    at java.lang.Thread.run(Thread.java:534)
    22:15:47,515 ERROR [Engine] StandardContext[/search]: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListe ner


    :roll: help me

  • #2
    Do you have multiple versions of Spring on the classpath?

    Rob

    Comment


    • #3
      Thanks Rob,

      It is working after i cleared the older version.

      Comment

      Working...
      X