-
Feb 20th, 2007, 10:49 PM
#1
org.springframework.beans.factory.NoSuchBeanDefini tionException
Hi,
I am getting the following exception when I try to get the values from the NORADII.properties file:
org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'NoradII' is defined: org.springframework.beans.factory.support.DefaultL istableBe
anFactory defining beans [userVldtnService,contVldtnService,custContInfoServ ice,custContCommService,invLstService,invDtlServic e,payLstService,payDtlService,cust
ContFilterService]; Root of BeanFactory hierarchy
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.getBeanDefinition(DefaultListab leBeanFactory.java:242)
at org.springframework.beans.factory.support.Abstract BeanFactory.getMergedBeanDefinition(AbstractBeanFa ctory.java:498)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:143)
at org.springframework.context.support.AbstractApplic ationContext.getBean(AbstractApplicationContext.ja va:399)
at com.ifs.ikonics.contract.CustContInfoDAO.getCustCo ntInfo(CustContInfoDAO.java:66)
at com.ifs.ikonics.contract.CustContInfoService.getCu stContInfo(CustContInfoService.java:47)
at com.ifs.ikonics.contract.CustContCmntController.on Submit(CustContCmntController.java:478)
at org.springframework.web.servlet.mvc.SimpleFormCont roller.processFormSubmission(SimpleFormController. java:202)
at org.springframework.web.servlet.mvc.AbstractFormCo ntroller.handleRequestInternal(AbstractFormControl ler.java:236)
at org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:121)
at org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:45)
at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:485)
at org.springframework.web.servlet.FrameworkServlet.s erviceWrapper(FrameworkServlet.java:342)
at org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:328)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:856)
at weblogic.servlet.internal.StubSecurityHelper$Servl etServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invok eServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute( ServletStubImpl.java:283)
at weblogic.servlet.internal.ServletStubImpl.execute( ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :3214)
at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.sec uredExecute(WebAppServletContext.java:1983)
at weblogic.servlet.internal.WebAppServletContext.exe cute(WebAppServletContext.java:1890)
at weblogic.servlet.internal.ServletRequestImpl.run(S ervletRequestImpl.java:1344)
at weblogic.work.ExecuteThread.execute(ExecuteThread. java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java :181)
My "NORADIIAppl-services.xml" file is as follow:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE beans (View Source for full doctype...)>
- <beans default-lazy-init="false" default-autowire="no" default-dependency-check="none">
<bean id="userVldtnService" class="com.ifs.ikonics.common.UserVldtnService" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default" />
<bean id="contVldtnService" class="com.ifs.ikonics.contract.ContVldtnService" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default" />
<bean id="custContInfoService" class="com.ifs.ikonics.contract.CustContInfoServic e" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default" />
<bean id="custContCommService" class="com.ifs.ikonics.contract.CustContCommServic e" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default" />
<bean id="invLstService" class="com.ifs.ikonics.invoice.InvLstService" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default" />
<bean id="invDtlService" class="com.ifs.ikonics.invoice.InvDtlService" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default" />
<bean id="payLstService" class="com.ifs.ikonics.invoice.PayLstService" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default" />
<bean id="payDtlService" class="com.ifs.ikonics.invoice.PayDtlService" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default" />
<bean id="custContFilterService" class="com.ifs.ikonics.contract.CustContFilterServ ice" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default" />
- <bean id="NoradII" class="org.springframework.beans.factory.config.Pr opertiesFactoryBean" abstract="false" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
- <property name="location">
<value>WEB-INF/properties/NORADII.properties</value>
</property>
</bean>
</beans>
And I have included the "NORADIIAppl-services.xml" in web.xml as follows:
- <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/NORADIIAppl-services.xml</param-value>
</context-param>
The following line in the code is throwing error:
Properties propers = (Properties)WebApplicationContextUtils.getWebAppli cationContext(application).getBean("NoradII");
Last edited by syed2007; Feb 20th, 2007 at 11:04 PM.
Thanks!
syed
-
Feb 21st, 2007, 02:02 AM
#2
When posting code please use the [ code][ /code] tags, it makes your code much more readable.
For further debugging, please put your log level to debug, there is probably something going wrong with initializing or reading your properties file.
I would rewrite WEB-INF/somefile to /WEB-INF/somefile.
Also I wonder why are you looking up your beans instead of injecting them into the other beans?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules