Results 1 to 2 of 2

Thread: Context initialization failed: BeanDefinitionStoreException

  1. #1
    Join Date
    Oct 2010
    Posts
    4

    Default Context initialization failed: BeanDefinitionStoreException

    Hi All,
    I have a J2EE based web application which perfectly gets deployed on JBoss 6.0 app server. I am using JBoss's "default" server configuration. My ".ear" file contains EJBs and a ".war" file - I am using Spring Security 3.0.5 release for user authentication and authorization.

    When I deploy the same ear file on JBoss 6.1, I find my WAR deployment fails with following errors. Surprising thing is: if I deploy the same ".ear" file in exploded format, then the deployment is successful.

    22:31:14,827 INFO [StdSchedulerFactory] Quartz scheduler version: 1.8.3
    22:31:14,828 INFO [QuartzScheduler] Scheduler EdmQuartzScheduler_$_NON_CLUSTERED started.
    22:31:14,828 INFO [QuartzService] QuartzService(EdmQuartzMBean) started.
    22:31:14,837 INFO [TomcatDeployment] deploy, ctxPath=/edm
    22:31:14,896 INFO [[/edm]] Initializing Spring root WebApplicationContext
    22:31:14,897 INFO [ContextLoader] Root WebApplicationContext: initialization started
    22:31:14,907 INFO [XmlWebApplicationContext] Refreshing Root WebApplicationContext: startup date [Wed Sep 21 22:31:14 PDT 2011]; rootof context hierarchy
    22:31:14,910 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext-business.xml]
    22:31:14,911 ERROR [ContextLoader] Context initialization failed: org.springframework.beans.factory.BeanDefinitionSt oreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext-business.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext-business.xml]
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:341) [:3.0.5.RELEASE]
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:302) [:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:143) [:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:178) [:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:149) [:3.0.5.RELEASE]
    at org.springframework.web.context.support.XmlWebAppl icationContext.loadBeanDefinitions(XmlWebApplicati onContext.java:124) [:3.0.5.RELEASE]
    at org.springframework.web.context.support.XmlWebAppl icationContext.loadBeanDefinitions(XmlWebApplicati onContext.java:93) [:3.0.5.RELEASE]
    at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:130) [:3.0.5.RELEASE]
    at org.springframework.context.support.AbstractApplic ationContext.obtainFreshBeanFactory(AbstractApplic ationContext.java:467) [:3.0.5.RELEASE]
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:397) [:3.0.5.RELEASE]
    at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:276) [:3.0.5.RELEASE]
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:197) [:3.0.5.RELEASE]
    at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 47) [:3.0.5.RELEASE]
    at org.apache.catalina.core.StandardContext.contextLi stenerStart(StandardContext.java:3369) [:6.1.0.Final]
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:3828) [:6.1.0.Final]
    at org.jboss.web.tomcat.service.deployers.TomcatDeplo yment.performDeployInternal(TomcatDeployment.java: 294) [:6.1.0.Final]
    at org.jboss.web.tomcat.service.deployers.TomcatDeplo yment.performDeploy(TomcatDeployment.java:146) [:6.1.0.Final]
    at org.jboss.web.deployers.AbstractWarDeployment.star t(AbstractWarDeployment.java:476) [:6.1.0.Final]
    at org.jboss.web.deployers.WebModule.startModule(WebM odule.java:118) [:6.1.0.Final]
    at org.jboss.web.deployers.WebModule.start(WebModule. java:95) [:6.1.0.Final]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method) [:1.6.0_27]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39) [:1.6.0_27]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25) [:1.6.0_27]
    at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_27]
    at org.jboss.mx.interceptor.ReflectedDispatcher.invok e(ReflectedDispatcher.java:157) [:6.0.0.GA]
    at org.jboss.mx.server.Invocation.dispatch(Invocation .java:96) [:6.0.0.GA]
    at org.jboss.mx.server.Invocation.invoke(Invocation.j ava:88) [:6.0.0.GA]
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(Ab stractMBeanInvoker.java:271) [:6.0.0.GA]
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanSe rverImpl.java:670) [:6.0.0.GA]
    at org.jboss.system.microcontainer.ServiceProxy.invok e(ServiceProxy.java:206) [:2.2.0.SP2]
    at $Proxy41.start(Unknown Source) at org.jboss.system.microcontainer.StartStopLifecycle Action.installAction(StartStopLifecycleAction.java :53) [:2.2.0.SP2]
    at org.jboss.system.microcontainer.StartStopLifecycle Action.installAction(StartStopLifecycleAction.java :41) [:2.2.0.SP2]
    at org.jboss.dependency.plugins.action.SimpleControll erContextAction.simpleInstallAction(SimpleControll erContextAction.java:62) [jboss-dependency.jar:2.2.0.SP2]
    at org.jboss.dependency.plugins.action.AccessControll erContextAction.install(AccessControllerContextAct ion.java:71) [jboss-dependency.jar:2.2.0.SP2]
    at org.jboss.dependency.plugins.AbstractControllerCon textActions.install(AbstractControllerContextActio ns.java:51) [jboss-dependency.jar:2.2.0.SP2]
    at org.jboss.dependency.plugins.AbstractControllerCon text.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.SP2]
    at org.jboss.system.microcontainer.ServiceControllerC ontext.install(ServiceControllerContext.java:301) [:2.2.0.SP2]
    at org.jboss.dependency.plugins.AbstractController.in stall(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.SP2]
    at org.jboss.dependency.plugins.AbstractController.in crementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.SP2]
    .
    .
    .
    .



    In my WAR's web.xml I have specified Spring configuration file locations as:


    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
    /WEB-INF/applicationContext-business.xml
    /WEB-INF/applicationContext-security.xml
    </param-value>
    </context-param>


    I have verified that the XML files do not have any syntax issue and those files are indeed packaged under WAR's WEB-INF directory. Now I believe JBoss uses Tomcat which unpacks the WAR file. So it seems that the files cannot be found on the classpath when the WAR file is loaded and/or it is not being unpacked.

    I have no clue how it successfully works in JBoss 6.0 but fails on 6.1. There are more bug fixes in 6.1 but internal structure or libraries are not changed between these 2 releases.

    Can anyone please suggest why Spring cannot find those configuration files when the "ear" is deployed in archived/collapsed format? Do I need to package such configuration files under WEB-INF/classes or should I use any prefix like "classpath:" in param-value tags?

    Many thanks in advance.
    Last edited by kuntalm; Sep 22nd, 2011 at 02:06 PM.

  2. #2
    Join Date
    Oct 2010
    Posts
    4

    Default

    No one faced this problem??
    Or people does not read this forum??

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •