org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [X.X.common.domain.dao.impl.DaoFactory$TestDaoImpl] is defined: expected single bean but found 0:

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 Spring JIRA by David Harrigan, 1 year ago
No unique bean of type [X.X.common.domain.dao.impl.DaoFactory$TestDaoImpl] is defined: expected single bean but found 0:
via Spring JIRA by David Harrigan, 1 year ago
No unique bean of type [X.X.common.domain.dao.impl.DaoFactory$TestDaoImpl] is defined: expected single bean but found 0:
via Stack Overflow by Dani
, 1 year ago
No qualifying bean of type [com.pjcom.springaop.message.impl.MessagePrinter] is defined
via GitHub by zeldigas
, 6 months ago
No qualifying bean of type [org.springframework.boot.autoconfigure.web.ErrorController] is defined
via Google Groups by Radu Chilom, 2 years ago
No unique bean of type [com.aievas.star.shared.services.StarRequestFactory$RaduRequestContext] is defined: expected single bean but found 0:
via Coderanch by Radu Chilom, 10 months ago
No unique bean of type [com.base.star.shared.services.StarRequestFactory$RaduRequestContext] is defined: expected single bean but found 0:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [X.X.common.domain.dao.impl.DaoFactory$TestDaoImpl] is defined: expected single bean but found 0:
at X.X.common.domain.dao.impl.DaoFactory.getTestDao(DaoFactory.java:21)
at X.X.common.domain.dao.impl.DaoFactoryTest.assertGetArticleDao(DaoFactoryTest.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
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
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
3 times, 1 year ago
Once, 3 weeks ago

Write tip

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