org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.foo.data.repository.RepositoryTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.foo.data.repository.UserRepository com.foo.data.repository.RepositoryTest.userRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: No [ManagedType] was found for the key class [com.foo.data.model.User] in the Metamodel - please verify that the [Managed] class was referenced in persistence.xml using a specific <class>com.foo.data.model.User</class> property or a global <exclude-unlisted-classes>false</exclude-unlisted-classes> element.

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

,
via Stack Overflow by Al Sweetman

Check Servers Launch Configuration in Eclipse. See the details below.

,
via playframework.com by Unknown author

Add guice to the dependencies.

libraryDependencies += guice

Solutions on the web

via eclipse.org by Unknown author, 1 year ago
; nested exception is java.lang.IllegalArgumentException: No [ManagedType] was found for the key class [com.foo.data.model.User] in the Metamodel - please verify that the [Managed] class was referenced in persistence.xml using a specific <class>com.foo.data.model.User</class> property or a global <exclude-unlisted-classes>false</exclude-unlisted-classes> element.
via Stack Overflow by Robert Mark Bram
, 1 year ago
; nested exception is java.lang.IllegalArgumentException: No [ManagedType] was found for the key class [com.foo.data.model.User] in the Metamodel - please verify that the [Managed] class was referenced in persistence.xml using a specific <class>com.foo.data.model.User</class> property or a global <exclude-unlisted-classes>false</exclude-unlisted-classes> element.
via Stack Overflow by chetank
, 2 years ago
Error creating bean with name 'com.ccd.walmart.test.CustomerTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field
via Spring JIRA by John Blum, 1 year ago
Error creating bean with name 'org.spring.data.gemfire.cache.SubRegionRepositoryTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private
via Spring JIRA by John Blum, 1 year ago
Error creating bean with name 'org.spring.data.gemfire.cache.SubRegionRepositoryTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private
via https://bugzilla.redhat.com/bugzilla/ by Josh West, 1 year ago
Error creating bean with name 'com.redhat.solutions.bpms.JbpmSampleIntTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.foo.data.repository.RepositoryTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.foo.data.repository.UserRepository com.foo.data.repository.RepositoryTest.userRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: No [ManagedType] was found for the key class [com.foo.data.model.User] in the Metamodel - please verify that the [Managed] class was referenced in persistence.xml using a specific <class>com.foo.data.model.User</class> property or a global <exclude-unlisted-classes>false</exclude-unlisted-classes> element.
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:110)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:312)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:284)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 month ago
Samebug visitor profile picture
Unknown user
Once, 1 month ago
7 times, 2 months ago
113 more bugmates

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