struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alberto A. Flores" <aaflo...@gmail.com>
Subject Re: Struts 1.3 + Spring -> "No WebApplicationContext found: no ContextLoaderListener registered?"
Date Tue, 01 Apr 2008 19:39:56 GMT
Have you added the contextLoaderListener in web.xml?

Yayo wrote:
> Hi and thanks in advance!
> 
> I've got a struts - spring based application and a declared bean wich
> implements both ApplicationContextAware and ServletContextAware. I debug the
> code and both setters receive data but when I try to use the servletContext
> it spites me this error:
> 
> 21:15:56,031 ERROR ContextLoader:214 - Context initialization failed
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'updateFeedProcessTarget' defined in ServletContext resource
> [/WEB-INF/spring/batch.xml]: Invocation of init method failed; nested
> exception is java.lang.IllegalStateException: No WebApplicationContext
> found: no ContextLoaderListener registered?
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean
> (AbstractAutowireCapableBeanFactory.java:1302)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean
> (AbstractAutowireCapableBeanFactory.java:463)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run
> (AbstractAutowireCapableBeanFactory.java:404)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean
> (AbstractAutowireCapableBeanFactory.java:375)
>     at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(
> AbstractBeanFactory.java:263)
>     at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton
> (DefaultSingletonBeanRegistry.java:170)
>     at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(
> AbstractBeanFactory.java:260)
>     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
> (AbstractBeanFactory.java:184)
>     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
> (AbstractBeanFactory.java:163)
>     at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons
> (DefaultListableBeanFactory.java:430)
>     at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization
> (AbstractApplicationContext.java:729)
>     at
> org.springframework.context.support.AbstractApplicationContext.refresh(
> AbstractApplicationContext.java:381)
>     at
> org.springframework.web.context.ContextLoader.createWebApplicationContext(
> ContextLoader.java:254)
>     at
> org.springframework.web.context.ContextLoader.initWebApplicationContext(
> ContextLoader.java:198)
>     at
> org.springframework.web.context.ContextLoaderListener.contextInitialized(
> ContextLoaderListener.java:45)
>     at org.apache.catalina.core.StandardContext.listenerStart(
> StandardContext.java:3827)
>     at org.apache.catalina.core.StandardContext.start(StandardContext.java
> :4334)
>     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
>     at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
>     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
>     at org.apache.catalina.core.StandardEngine.start(StandardEngine.java
> :443)
>     at org.apache.catalina.core.StandardService.start(StandardService.java
> :516)
>     at org.apache.catalina.core.StandardServer.start(StandardServer.java
> :710)
>     at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
>     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.catalina.startup.Bootstrap.start(Bootstrap.java:288)
>     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
> Caused by: java.lang.IllegalStateException: No WebApplicationContext found:
> no ContextLoaderListener registered?
>     at
> org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext
> (WebApplicationContextUtils.java:95)
>     at com.eduyayo.select.batch.Process.getSession(Process.java:153)
>     at com.eduyayo.select.batch.Process.init(Process.java:73)
>     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.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod
> (AbstractAutowireCapableBeanFactory.java:1378)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods
> (AbstractAutowireCapableBeanFactory.java:1339)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean
> (AbstractAutowireCapableBeanFactory.java:1299)
>     ... 30 more:
> 
> 
> 

-- 

Alberto A. Flores
http://www.linkedin.com/in/aflores



Mime
View raw message