File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
video training course this week in the
Other Application Frameworks
NoSuchBeanDefinitionException in Spring
Joined: May 30, 2007
Oct 25, 2007 06:27:00
I am doing the following -
I have a parent application bean context which does not construct any beans.
ApplicationBeanContext parent = new FileSystemXmlApplicationContext("empty.xml");
I have two children contexts, child1 and child2
ApplicationBeanContext child1 = new FileSystemXmlApplicationContext("child1.xml",parent);
<bean id="child1" class="child1">
ApplicationBeanContext child2 = new FileSystemXmlApplicationContext("child2.xml",parent);
<bean id="child2" class="child2">
(The code above is pseudo code)
Basically, I've configured child1 and child2 contexts to have the same parent. At child2's object initialisation, I get the following error
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'child1' is defined:
Is this because I'm giving the xml files to the child contexts and not the parent context? Is there any solution for this?
Thanks in advanace
Joined: Jul 11, 2001
Oct 25, 2007 09:40:00
How do you suppose Child2 is supposed to know anything about Child1?
GenRocket - Experts at Building Test Data
Joined: Jan 01, 2007
Oct 28, 2007 23:10:00
Is this because I'm giving the xml files to the child contexts and not the parent context?
yeah...you have the answer
Milan.<br />I can because I think I can...
Joined: May 30, 2007
Oct 29, 2007 22:12:00
Thank you for the replies
It is sorta covered in the
JavaRanch Style Guide
subject: NoSuchBeanDefinitionException in Spring
Inheritance in Java
Problem JAXB Unmarshaller if order of XML tags differs.
Disposable bean's destroy method is not being called ???
Error coming in using JDO with Spring framework.
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015