Originally posted by Shanmugam Muthukumarasamy:
Another interesting point that I noticed while creating the beans.xml.
I have followed the steps below to create the beans.xml
1. Right click on my project (HelloWorld) and "New" -> "Spring" -> "Create Bean Definition".
2. This creates the beans.xml right under the HelloWorld folder.
That is the reason I kept that file under the same location. I will try your suggestion and let you know.
I dont know what is wrong previously my beans.xml file was there inside the project based on the suggestion on this page i moved to src but no good end result.
Christophe Verré wrote:ClassPathXmlApplicationContext allows you to search for context files in the CLASSPATH. I assume that you know what the classpath is. If you don't, check this FAQ. If you want to use a full path, use FileSystemXmlApplicationContext instead (echoing Trilochan's suggestion).
Trilochan Bharadwaj wrote:Dude,
Use FileSystemXXXAppContext and Resource if you wanna use the full file path, but if you still wanna use the xml file, put it under a package within a source folder, something like say src/main/resources (<-- this would be your source folder), then use a package x.y.y and put the file in there, then use x/y/z/beans.xml in your app context initialization code.
Also, if you don't wanna package your stuff like that, put the xml inside the package where your "Hello World" POJO lies.