File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Application Frameworks and the fly likes Splring: ContextLoaderListener not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Splring: ContextLoaderListener not working" Watch "Splring: ContextLoaderListener not working" New topic

Splring: ContextLoaderListener not working

Nina Anderson
Ranch Hand

Joined: Jul 18, 2006
Posts: 148
Hi guys,

I'm using the springframeWork to initialize my hiberate classes which are location in my /WEB-INF/applicationContext.xml. However, when I try to start up my server, my strut action classes configuration in ContextLoaderPlugIn cannot find the bean classes defined in the applicationContext.

The following is the error I'm getting:
[9/15/07 3:49:14:421 PDT] 00000018 WebExtensionP W Servlet action_tmp is currently unavailable: null
[9/15/07 3:49:16:187 PDT] 00000018 WebApp A SRVE0180I: [PBTest#PBWebApp.war] [/PBWebApp] [Servlet.LOG]: Initializing WebApplicationContext for Struts ActionServlet 'action', module ''
[9/15/07 3:49:16:281 PDT] 00000018 WebApp A SRVE0181I: [PBTest#PBWebApp.war] [/PBWebApp] [Servlet.LOG]: action: null: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/displayAddImages' defined in ServletContext resource [/WEB-INF/presentationContext.xml]: Cannot resolve reference to bean 'businessBS' while setting bean property 'businessBS'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'businessBS' is defined

Here's my code:

<!-- =================== Define Spring Bean Definition Files to be loaded ================== -->



<!-- =================== Spring Context Loader Servlet ================== -->

///APPLiCATION Context.xml /////

<bean id="businessBSTarget" class="">
<property name="businessDao"><ref local="businessDao" /></property>
<bean id="businessBS" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<property name="target">
<ref local="businessBSTarget" />
<property name="interceptorNames">


<!-- ============================= Spring Plugin ================================== -->

<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">

/////////Action bean context: presentationContext.xml ////////

<bean name="/displayAddImages" class="com.poshWebApp.action.AddImageDisplayAction">
<property name="businessBS"><ref bean="businessBS" /></property>
<property name="paymentProcessBS"><ref bean="paymentProcessBS" /></property>

Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

I wonder if it could be related with the following bug :

Try using this instead:

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: Splring: ContextLoaderListener not working
It's not a secret anymore!