org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'UserManagerIntTests': Unsatisfied dependency expressed through bean property 'dataSource': There are 2 beans of type [interface javax.sql.DataSource] for autowire by type. There should have been exactly 1 to be able to autowire property 'dataSource' of bean 'UserManagerIntTests'. Consider using autowire by name instead.

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

Solutions on the web

via Spring JIRA by John Purcell, 1 year ago
Error creating bean with name 'UserManagerIntTests': Unsatisfied dependency expressed through bean property 'dataSource': There are 2 beans of type [interface javax.sql.DataSource] for autowire by type. There should have been exactly 1 to be able to autowire property 'dataSource' of bean 'UserManagerIntTests'. Consider using autowire by name instead.
via Spring JIRA by John Purcell, 1 year ago
Error creating bean with name 'UserManagerIntTests': Unsatisfied dependency expressed through bean property 'dataSource': There are 2 beans of type [interface javax.sql.DataSource] for autowire by type. There should have been exactly 1 to be able to autowire property 'dataSource' of bean 'UserManagerIntTests'. Consider using autowire by name instead.
via alvinalexander.com by Unknown author, 1 year ago
Error creating bean with name 'com.devdaily.ftpfilemover.dao.FTPFileMoverDaoTests': Unsatisfied dependency expressed through bean property 'dataSource': : No unique bean of type [javax.sql.DataSource] is defined: expected single matching bean but
via spring.io by Unknown author, 2 years ago
Error creating bean with name 'com.onicomconsulting.core.bdo.enums.EnumerationCheck': Unsatisfied dependency expressed through bean property 'dataSource': There are 2 beans of type [interface javax.sql.DataSource] for autowire by type. There should have been 1 to be able to autowire property 'dataSource' of bean 'com.onicomconsulting.core.bdo.enums.EnumerationCheck'.
via Spring JIRA by Graham Zabel, 1 year ago
Error creating bean with name 'com.rbos.nucleus.integration.db.dao.ReferenceDataDaoTest': Unsatisfied dependency expressed through bean property 'referenceDataDao': : No bean named 'referenceDataDao' is defined; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'referenceDataDao' is defined
via Spring JIRA by Graham Zabel, 1 year ago
Error creating bean with name 'com.rbos.nucleus.integration.db.dao.ReferenceDataDaoTest': Unsatisfied dependency expressed through bean property 'referenceDataDao': : No bean named 'referenceDataDao' is defined; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'referenceDataDao' is defined
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'UserManagerIntTests': Unsatisfied dependency expressed through bean property 'dataSource': There are 2 beans of type [interface javax.sql.DataSource] for autowire by type. There should have been exactly 1 to be able to autowire property 'dataSource' of bean 'UserManagerIntTests'. Consider using autowire by name instead.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:698)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:604)
at org.springframework.test.AbstractDependencyInjectionSpringContextTests.injectDependencies(AbstractDependencyInjectionSpringContextTests.java:223)
at org.springframework.test.AbstractDependencyInjectionSpringContextTests.setUp(AbstractDependencyInjectionSpringContextTests.java:195)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)

Users with the same issue

4 times, 4 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago

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