IntelliJ Java IDE
The moose likes Other Application Frameworks and the fly likes No bean named 'anyBean' is defined [Just want Spring an iBatis together] Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Other Application Frameworks
Reply Bookmark "No bean named Watch "No bean named New topic
Author

No bean named 'anyBean' is defined [Just want Spring an iBatis together]

soeren
Greenhorn

Joined: Sep 18, 2008
Posts: 2
Hello folks,

I'm so frustrated. I'm working on this problem since yesterday and I'm just dancing around the problem. It have to be a very simple issue. Hope so!

OK, i've this file/folder structure:

myProject.src.java.myProject.domain.User.java
myProject.src.java.myProject.domain.maps.User.xml
myProject.src.java.myProject.service.Administrable.java
myProject.src.java.myProject.service.UserManager.java
myProject.web.WEB-INF.applicationContext.xmlmyProject.web.WEB-INF.sqlmap-config.xml
myProject.test.myProject.service.UserManagerTest.java

applicationContext.xml



sqlmap-config.xml



And in my UserManagerTest.java I do this



And it keeps and keeps saying: "No bean named 'userManager' is defined."
I checked get ac.getAliases() and it contains nothing. What is wrong?

I need help!

Thank you all for hints to solve this.
soeren
Greenhorn

Joined: Sep 18, 2008
Posts: 2
OK I just got it fixed.
I solved the problem by moving the spring xml files to classpath-root.
I think I used "classpath:**/" wrong. I'm very new to this java things.

I'm better in coding little C.
Eugene Williams
Greenhorn

Joined: Jan 31, 2010
Posts: 20
For those of you who may have found this via a web search - this problem may occur if somewhere on your classpath there exists an older version of the applicationContext.xml file
(either resident on the server or in some other location on your classpath) which may not be updated when you update the application during the edit and deploy process.

To solve the problem, perform a search on your system, locate any applicationContext.xml file - open it, if the file is associated with your application, verify that it references beans which you've added in your most recent iteration of development.

If not, and you prefer not to delete these files, update their contents by copying and pasting the most updated applicationContext file into the ones which are found. I hope this makes sense.
 
 
subject: No bean named 'anyBean' is defined [Just want Spring an iBatis together]
 
Threads others viewed
Problem in iBATIS sqlMapConfig.xml
Metro-iBATIS Problem while deploying web service using iBatis as mapping techonlogy.
WHAT AM I MISSING? iBatis - sqlMapConfig.xml
iBatis
Spring in CMT MDB
developer file tools