This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Spring and the fly likes org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'id' is defined Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named Watch "org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named New topic
Author

org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'id' is defined

Satyajeet Kadam
Ranch Hand

Joined: Oct 19, 2006
Posts: 215
Q1)Please let me what has gone wrong in beans.xml?. I am getting error as "org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'id' is defined " when i run the program.


Main.java


Code.java


Asp.java



beans.xml



I am geeting error as


David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Well, Main.java:13 tries to get a bean named "id", and there isn't one. I suspect you meant "name", which is also not terribly clear.

Also, when posting code/stacktraces/etc. please make sure to wrap very long lines, otherwise we have to scroll to the right quite far in order read your post, edit our post, etc.
Satyajeet Kadam
Ranch Hand

Joined: Oct 19, 2006
Posts: 215
Thanks for your reply.

Event after changing this line from




to this line.






I am still getting the error?



David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What do you mean, "still getting the error"? That's a completely different error.
Satyajeet Kadam
Ranch Hand

Joined: Oct 19, 2006
Posts: 215
I am Sorry.I appreciate you have helped me. But i mean that i am still getting new error. Can you please helpe me?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

This is your error

Caused by: java.lang.IllegalArgumentException: error at ::0 can't find referenced pointcut display

So there appears to be something wrong in your AOP configuration. Either your pointcut is incorrect, or you are using a named pointcut and the Advice is trying to
point to the name, and it is an incorrect name.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
jQuery in Action, 2nd edition
 
subject: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'id' is defined
 
Similar Threads
Spring AOP issue
AOP logging throws exception
Spring AOP HELP needed
cvc-complex-type.2.3:Element 'beans' cannot have character [children] type's content type is element
Spring 2.5 and AOP - BeanPostProcessor before instantiation of bean failed