org.springframework.beans.factory.UnsatisfiedDependencyException

tip

Springboot auto-configuration is disabled when you try to use WebMvcConfigurerAdapter and @EnableWebMvc. If WebConfig is not of the essence, remove it and use SpringBoot auto-configuration.

tip

If you want to keep using @EnableWebMvc annotation, you have to add the code on the first answer of this page: https://goo.gl/JoHTKU to your code

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Fresh install of Stash 2.12.0 going against mysql. Single user, single project created, single repository. Backup is created successfully. Restore run with this command: java -Djdbc.override=true -Djdbc.driver=com.mysql.jdbc.Driver -Djdbc.url="jdbc:mysql://localhost:3306/stashnew?autoReconnect=true&characterEncoding=utf8&useUnicode=true&sessionVariables=storage_engine%3DInnoDB" -Djdbc.user=stashuser -Djdbc.password=password -Dstash.home="/opt/atlassian/stash" -jar /opt/atlassian/stash-backup-client-1.2.0/stash-restore-client.jar /opt/atlassian/stash-backup-client-1.2.0/backups/stash-20140327-164217-020.tar Results: 2014-03-27 16:44:21,719 INFO Initializing 2014-03-27 16:44:23,199 ERROR The application could not be started. An unexpected error prevented the Spring ApplicationContext from being created. Details of the error follow. org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'liquibaseDao' defined in class path resource [META-INF/spring/restore-spring.xml]: Unsatisfied dependency expressed through constructor argument with index 1 of type [com.google.common.base.Supplier]: : No qualifying bean of type [com.google.common.base.Supplier] is defined: expected single matching bean but found 2: backupDataSourceSupplier,databaseService; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.google.common.base.Supplier] is defined: expected single matching bean but found 2: backupDataSourceSupplier,databaseService at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:742) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:196) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] ... 14 more frames available in the log file
    via by Jere Krischel,
  • Restore client cannot start (Spring-IoC-related stack trace). stash-restore-client v .1.2.0 (as you can see below) Below is the command line and the output output of restore client Kirills-MacBook-Pro:stash-backup-client-1.2.0 kirillfrolov$ java -Dstash.home=/Users/kirillfrolov/Documents/atlassian/stash -jar stash-restore-client.jar /Users/kirillfrolov/frameworks/stash-backup-data/backups/stash-20140329-220413-690.tar 2014-03-29 22:15:58,881 INFO Initializing 2014-03-29 22:15:59,412 ERROR The application could not be started. An unexpected error prevented the Spring ApplicationContext from being created. Details of the error follow. org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'liquibaseDao' defined in class path resource [META-INF/spring/restore-spring.xml]: Unsatisfied dependency expressed through constructor argument with index 1 of type [com.google.common.base.Supplier]: : No qualifying bean of type [com.google.common.base.Supplier] is defined: expected single matching bean but found 2: backupDataSourceSupplier,databaseService; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.google.common.base.Supplier] is defined: expected single matching bean but found 2: backupDataSourceSupplier,databaseService at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:742) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:196) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] ... 14 more frames available in the log file
    via by Kirill Frolov,
  • Fresh install of Stash 2.12.0 going against mysql. Single user, single project created, single repository. Backup is created successfully. Restore run with this command: java -Djdbc.override=true -Djdbc.driver=com.mysql.jdbc.Driver -Djdbc.url="jdbc:mysql://localhost:3306/stashnew?autoReconnect=true&characterEncoding=utf8&useUnicode=true&sessionVariables=storage_engine%3DInnoDB" -Djdbc.user=stashuser -Djdbc.password=password -Dstash.home="/opt/atlassian/stash" -jar /opt/atlassian/stash-backup-client-1.2.0/stash-restore-client.jar /opt/atlassian/stash-backup-client-1.2.0/backups/stash-20140327-164217-020.tar Results: 2014-03-27 16:44:21,719 INFO Initializing 2014-03-27 16:44:23,199 ERROR The application could not be started. An unexpected error prevented the Spring ApplicationContext from being created. Details of the error follow. org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'liquibaseDao' defined in class path resource [META-INF/spring/restore-spring.xml]: Unsatisfied dependency expressed through constructor argument with index 1 of type [com.google.common.base.Supplier]: : No qualifying bean of type [com.google.common.base.Supplier] is defined: expected single matching bean but found 2: backupDataSourceSupplier,databaseService; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.google.common.base.Supplier] is defined: expected single matching bean but found 2: backupDataSourceSupplier,databaseService at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:742) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:196) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] ... 14 more frames available in the log file
    via by Jere Krischel,
  • Restore client cannot start (Spring-IoC-related stack trace). stash-restore-client v .1.2.0 (as you can see below) Below is the command line and the output output of restore client Kirills-MacBook-Pro:stash-backup-client-1.2.0 kirillfrolov$ java -Dstash.home=/Users/kirillfrolov/Documents/atlassian/stash -jar stash-restore-client.jar /Users/kirillfrolov/frameworks/stash-backup-data/backups/stash-20140329-220413-690.tar 2014-03-29 22:15:58,881 INFO Initializing 2014-03-29 22:15:59,412 ERROR The application could not be started. An unexpected error prevented the Spring ApplicationContext from being created. Details of the error follow. org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'liquibaseDao' defined in class path resource [META-INF/spring/restore-spring.xml]: Unsatisfied dependency expressed through constructor argument with index 1 of type [com.google.common.base.Supplier]: : No qualifying bean of type [com.google.common.base.Supplier] is defined: expected single matching bean but found 2: backupDataSourceSupplier,databaseService; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.google.common.base.Supplier] is defined: expected single matching bean but found 2: backupDataSourceSupplier,databaseService at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:742) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:196) ~[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] ... 14 more frames available in the log file
    via by Kirill Frolov,
    • org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'liquibaseDao' defined in class path resource [META-INF/spring/restore-spring.xml]: Unsatisfied dependency expressed through constructor argument with index 1 of type [com.google.common.base.Supplier]: : No qualifying bean of type [com.google.common.base.Supplier] is defined: expected single matching bean but found 2: backupDataSourceSupplier,databaseService; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.google.common.base.Supplier] is defined: expected single matching bean but found 2: backupDataSourceSupplier,databaseService at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:742)[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:196)[spring-beans-4.0.0.RELEASE.jar:4.0.0.RELEASE]

    Users with the same issue

    dafman
    2 times, last one,
    Unknown visitor1 times, last one,
    marcbouvierdav
    339 times, last one,
    nasimk
    39 times, last one,
    Unknown visitor1 times, last one,
    35 more bugmates