XBean
  1. XBean
  2. XBEAN-121

Constructor injection doesn't work with constructor argument of type array

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.5
    • Fix Version/s: 3.12
    • Component/s: None
    • Labels:
      None

      Description

      A sample class:
      package test;
      public class SomeBean {
      private final String[] arguments;
      public SomeBean(String[] arguments)

      { this.arguments = arguments; }

      }

      And mapping configuration:
      something = test.SomeBean
      test.SomeBean(java.lang.String[]).parameterNames = arguments

      Using:
      <myNs:something arguments="#..."/>
      causes:

      Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [test.SomeBean]: No default constructor found; nested exception is java.lang.NoSuchMethodException: test.SomeBean.<init>()

        Activity

        Hide
        Shawn Jiang added a comment -

        Are you experiencing the same problem with the latest 3.6 snapshot ?

        Show
        Shawn Jiang added a comment - Are you experiencing the same problem with the latest 3.6 snapshot ?
        Hide
        Guillaume Nodet added a comment -

        Adding src/test/java/org/apache/xbean/spring/context/Recipe2UsingXBeanTest.java
        Adding src/test/java/org/apache/xbean/spring/example/RecipeService2.java
        Adding src/test/resources/org/apache/xbean/spring/context/recipe2-xbean.xml
        Transmitting file data ...
        Committed revision 1393363.

        Show
        Guillaume Nodet added a comment - Adding src/test/java/org/apache/xbean/spring/context/Recipe2UsingXBeanTest.java Adding src/test/java/org/apache/xbean/spring/example/RecipeService2.java Adding src/test/resources/org/apache/xbean/spring/context/recipe2-xbean.xml Transmitting file data ... Committed revision 1393363.

          People

          • Assignee:
            Guillaume Nodet
            Reporter:
            Piotr Bzdyl
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development