org.springframework.beans.factory.UnsatisfiedDependencyException

Error creating bean with name 'messageDigest' defined in file [E:\java\factory-method\services-context.xml]: Unsatisfied dependency expressed through constructor argument with index 1 of type [java.security.Provider]: Ambiguous constructor argument types - did you specify the correct bean references as generic constructor arguments?

Samebug tips2

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.


rafaelrafael

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


rafaelrafael

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web76

  • via Unknown by Jing Xue,
  • via Unknown by Jing Xue,
  • via Unknown by IGNACIO SORIANO DORADO,
  • Stack trace

    • org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'messageDigest' defined in file [E:\java\factory-method\services-context.xml]: Unsatisfied dependency expressed through constructor argument with index 1 of type [java.security.Provider]: Ambiguous constructor argument types - did you specify the correct bean references as generic constructor arguments? at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createArgumentArray(AbstractAutowireCapableBeanFactory.java:667) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:442) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:314) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:312) at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:82) at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:67) at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:58) at Main.main(Main.java:7)

    Write tip

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

    Users with the same issue

    batwalrus76batwalrus76
    7 times, last one
    Unknown visitor
    Unknown visitorOnce,
    Михайло ТітовМихайло Тітов
    4 times, last one
    marcbouvierdavmarcbouvierdav
    339 times, last one
    nasimknasimk
    39 times, last one
    27 more bugmates