Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Spring app shows NoSuchBeanDefinitionException  RSS feed

 
Mahmudul Islam
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello There, I am new to this forum. It's great to be here.
Anyway. I was practicing Spring framework Annotation Configuration using XML. I have a repository, a service and a main app. There is an implementation of repository (named "customerRepository") and service (named "customerService") and the But the problem is when I ran the main app it shows "NoSuchBeanDefinitionException" exception. But I think I have done all the things right way and service and repository Autowired correctly. But it still not working. Please guide me if I am wrong at any point. I am using java 8, and app configured using maven.
Here is the error:
Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'customerService' available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1087)
at Application.main(Application.java:16)

Here is the code:
Implemented classes>>



 
Mahmudul Islam
Greenhorn
Posts: 2
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, there was a typo and I couldn't find it at first. Anyway problem is solved.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!