Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-4004

Inner class instantiation problem

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • nightly
    • None
    • kernel
    • None

    Description

      Hi guys,
      I'm having problems using inner classes, if having a simple EchoService with an inner class like this:

      public class EchoService
      public MyInnerClass retMyInnerClass(MyInnerClass input)

      { return input; }

      public class MyInnerClass {
      private String name;

      public MyInnerClass() { }

      public void setName(String name)

      { this.name = name; }

      public String getName()

      { return this.name; }

      };
      }

      I am able to deploy it and invoke it with a generated ADB client, however, when the service receives the XML request and tries to create
      an instance of the inner class an exception gets thrown inside the DefaultObjectSupplier:

      Caused by: java.lang.InstantiationException: org.tempuri.test.EchoService$MyInnerClass
      at java.lang.Class.newInstance0(Class.java:335)
      at java.lang.Class.newInstance(Class.java:303)
      at org.apache.axis2.engine.DefaultObjectSupplier.getObject(DefaultObjectSupplier.java:28)
      ... 28 more

      The issue has been reported before, see AXIS2-2691, however it seems that the DefaultObjectSupplier patch provided there was never applied.
      Annogen changes were also required but since now (in the nightly build) Axis2 does not use annogen anymore, I think only the DefaultObjectSupplier patch is relevant.

      Attachments

        1. DefaultObjectSupplier.diff
          3 kB
          Detelin Yordanov

        Issue Links

          Activity

            People

              Unassigned Unassigned
              detyo Detelin Yordanov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: