• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Splring: ContextLoaderListener not working

 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
/////WEB.XML//////////////

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

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
<init-param>
<param-name>singleSession</param-name>
<param-value>true</param-value>
</init-param>
</filter>

<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>



<!-- =================== Spring Context Loader Servlet ================== -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>


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

<bean id="businessBSTarget" class="com.PBCoreApp.business.impl.BusinessBSImpl">
<property name="businessDao"><ref local="businessDao" /></property>
</bean>
<bean id="businessBS" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>com.PBCoreApp.business.BusinessBS</value>
</property>
<property name="target">
<ref local="businessBSTarget" />
</property>
<property name="interceptorNames">
<list>
<value>hibernateInterceptor</value>
</list>
</property>
</bean>


/////STRUTS-CONFIG//////

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

<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property
property="contextConfigLocation"
value="/WEB-INF/presentationContext.xml/>
</plug-in>


/////////Action bean context: presentationContext.xml ////////
<beans>

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


Pls...Help.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wonder if it could be related with the following bug :
http://sourceforge.net/tracker/index.php?func=detail&aid=1088866&group_id=39190&atid=424562

Try using this instead:
 
mooooooo ..... tiny ad ....
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic