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>>