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

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

You could me missing na annotation (@Service or @Component) or a definition in the xml. Also, look if the class where your implementation is located is properly scanned.

Solutions on the web

via Coderanch by Mimi Tam, 11 months ago
No bean named 'entityManagerFactory' is defined
via GitHub by gsteimer
, 1 year ago
No bean named 'ServiceRegistry' is defined
via GitHub by biddster
, 2 years ago
No bean named 'jacksonObjectMapper' is defined
via Spring JIRA by Jim Moore, 1 year ago
No bean named 'contactRepository' is defined
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'environment' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:568)
at undefined.Test.main(Test.java:7)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
Once, 2 weeks ago
2 times, 3 months ago
31 times, 3 months ago
130 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.