org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'testId' defined in class path resource [spring.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [[B]: Did you specify the correct bean references as generic constructor arguments?

Spring JIRA | Martin Thompson | 1 decade ago
  1. 0

    Exception gets logged causing confusion when running logging at DEBUG level for matching String constructor injection. Below is an example. <bean id="testId" class="java.lang.String"> <constructor-arg type="java.lang.String" index="0"> <value>testValue</value> </constructor-arg> </bean> [java] 2005-04-06 17:07:06,515 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanFactory - Ignoring constructor [public java.lang.String(byte[],int,int,int)] of bean 'testId': could not satisfy dependencies [java] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'testId' defined in class path resource [spring.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [[B]: Did you specify the correct bean references as generic constructor arguments? [java] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createArgumentArray(AbstractAutowireCapableBeanFactory.java:622) [java] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:495) [java] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:306) [java] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:260) [java] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:221) [java] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145) [java] at TestStringBean.main(TestStringBean.java:11) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at java.lang.reflect.Method.invoke(Method.java:585) [java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:193) [java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:130) [java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:705) [java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:177) [java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:83) [java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) [java] at org.apache.tools.ant.Task.perform(Task.java:364) [java] at org.apache.tools.ant.Target.execute(Target.java:341) [java] at org.apache.tools.ant.Target.performTasks(Target.java:369) [java] at org.apache.tools.ant.Project.executeTarget(Project.java:1214) [java] at org.apache.tools.ant.Project.executeTargets(Project.java:1062) [java] at org.apache.tools.ant.Main.runBuild(Main.java:673) [java] at org.apache.tools.ant.Main.startAnt(Main.java:188) [java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196) [java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)

    Spring JIRA | 1 decade ago | Martin Thompson
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'testId' defined in class path resource [spring.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [[B]: Did you specify the correct bean references as generic constructor arguments?
  2. 0

    Exception gets logged causing confusion when running logging at DEBUG level for matching String constructor injection. Below is an example. <bean id="testId" class="java.lang.String"> <constructor-arg type="java.lang.String" index="0"> <value>testValue</value> </constructor-arg> </bean> [java] 2005-04-06 17:07:06,515 [main] DEBUG org.springframework.beans.factory.xml.XmlBeanFactory - Ignoring constructor [public java.lang.String(byte[],int,int,int)] of bean 'testId': could not satisfy dependencies [java] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'testId' defined in class path resource [spring.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [[B]: Did you specify the correct bean references as generic constructor arguments? [java] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createArgumentArray(AbstractAutowireCapableBeanFactory.java:622) [java] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:495) [java] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:306) [java] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:260) [java] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:221) [java] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145) [java] at TestStringBean.main(TestStringBean.java:11) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at java.lang.reflect.Method.invoke(Method.java:585) [java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:193) [java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:130) [java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:705) [java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:177) [java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:83) [java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) [java] at org.apache.tools.ant.Task.perform(Task.java:364) [java] at org.apache.tools.ant.Target.execute(Target.java:341) [java] at org.apache.tools.ant.Target.performTasks(Target.java:369) [java] at org.apache.tools.ant.Project.executeTarget(Project.java:1214) [java] at org.apache.tools.ant.Project.executeTargets(Project.java:1062) [java] at org.apache.tools.ant.Main.runBuild(Main.java:673) [java] at org.apache.tools.ant.Main.startAnt(Main.java:188) [java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196) [java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)

    Spring JIRA | 1 decade ago | Martin Thompson
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'testId' defined in class path resource [spring.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [[B]: Did you specify the correct bean references as generic constructor arguments?
  3. 0

    Error deploying a ROUTER sink when using scripts

    GitHub | 1 month ago | felipeg48
    java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    @Bean method with String parameter - exception

    Stack Overflow | 4 years ago | ServerSideCat
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'placeholder' defined in class TestPlacehodler: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.lang.String]: : No qualifying bean of type [java.lang.String] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [java.lang.String] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
  6. 0

    NoSuchBeanDefinitionException, but bean is defined - JavaHow.net

    javahow.net | 1 year ago
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'postF ilterAdvisor' defined in class path resource [test/project/security/aop/AopSecurityConfiguration.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springf ramework.security.access.intercept.aopalliance.MethodSecurityInterceptor]: : No qualifying bean of type [org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionEx ception: No qualifying bean of type [org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor] found for dependency: expected at least 1 bean which qualifies as autowire can didate for this dependency. Dependency annotations: {}

  1. tvrmsmith 2 times, last 3 months ago
10 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.springframework.beans.factory.UnsatisfiedDependencyException

    Error creating bean with name 'testId' defined in class path resource [spring.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [[B]: Did you specify the correct bean references as generic constructor arguments?

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createArgumentArray()
  2. Spring Beans
    AbstractBeanFactory.getBean
    1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createArgumentArray(AbstractAutowireCapableBeanFactory.java:622)
    2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:495)
    3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:306)
    4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:260)
    5. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:221)
    6. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)
    6 frames
  3. Unknown
    TestStringBean.main
    1. TestStringBean.main(TestStringBean.java:11)
    1 frame
  4. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:585)
    4 frames
  5. Ant
    Main.startAnt
    1. org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:193)
    2. org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:130)
    3. org.apache.tools.ant.taskdefs.Java.run(Java.java:705)
    4. org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:177)
    5. org.apache.tools.ant.taskdefs.Java.execute(Java.java:83)
    6. org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
    7. org.apache.tools.ant.Task.perform(Task.java:364)
    8. org.apache.tools.ant.Target.execute(Target.java:341)
    9. org.apache.tools.ant.Target.performTasks(Target.java:369)
    10. org.apache.tools.ant.Project.executeTarget(Project.java:1214)
    11. org.apache.tools.ant.Project.executeTargets(Project.java:1062)
    12. org.apache.tools.ant.Main.runBuild(Main.java:673)
    13. org.apache.tools.ant.Main.startAnt(Main.java:188)
    13 frames
  6. Apache Ant Launcher
    Launcher.main
    1. org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
    2. org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
    2 frames