Axis2
  1. Axis2
  2. AXIS2-5474

DefaultSchemaGenerator : properly handle failure when a bean property has no getReadMethod()

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Trivial Trivial
    • Resolution: Unresolved
    • Affects Version/s: 1.6.2
    • Fix Version/s: None
    • Component/s: kernel
    • Labels:

      Description

      Deployment of service (aar file) might failed with :

      Caused by: org.apache.axis2.deployment.DeploymentException: The following error occurred during schema generation: null
      at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:396)
      ... 35 more
      Caused by: java.lang.NullPointerException
      at org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.generateSchema(DefaultSchemaGenerator.java:606)
      at org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.generateSchemaTypeforNameCommon(DefaultSchemaGenerator.java:1092)

      In which the getReadMethod() is returning null for a bean property, thus to make it more friendly and avoid anyone loosing time on such things :

      — DefaultSchemaGenerator.java 2013-01-08 10:09:33.000000000 +0100
      +++ DefaultSchemaGenerator.java.new 2013-01-08 10:09:17.000000000 +0100
      @@ -603,6 +603,9 @@
      String propertyName = property.getName();
      if (!property.getName().equals("class") && (property.getPropertyType() != null)) {
      if ((beanExcludeInfo == null) || !beanExcludeInfo.isExcludedProperty(propertyName)) {
      + if (property.getReadMethod() == null)

      { + throw new Exception("Failed property ("+property.getName()+") has no getReadMethod() method in Class ("+javaType+")"); + }

      Type genericFieldType = property.getReadMethod().getGenericReturnType();
      if(genericFieldType instanceof ParameterizedType){
      ParameterizedType aType = (ParameterizedType) genericFieldType;

      1. patch.diff
        0.9 kB
        Philippe Le Berre

        Activity

        Hide
        Mark Carpenter added a comment -

        I am experiencing this exact issue with my webservices in axis2 1.6.2. Can someone send a .class file with this fix in it so that I can see why my webservice deployment keeps failing?

        Thanks,
        Mark Carpenter

        Show
        Mark Carpenter added a comment - I am experiencing this exact issue with my webservices in axis2 1.6.2. Can someone send a .class file with this fix in it so that I can see why my webservice deployment keeps failing? Thanks, Mark Carpenter
        Hide
        Kishanthan Thangarajah added a comment -

        Philippe,
        You can add your fix as a patch here, so that the developers will review and commit it to the trunk.

        Kishanthan.

        Show
        Kishanthan Thangarajah added a comment - Philippe, You can add your fix as a patch here, so that the developers will review and commit it to the trunk. Kishanthan.
        Show
        Philippe Le Berre added a comment - Mark, A fixed kernerl.jar is available at http://esis.svn.sourceforge.net/viewvc/esis/main/jars/axis2-1.6.2/lib/axis2-kernel-1.6.2.jar?revision=3693 Philippe
        Hide
        Philippe Le Berre added a comment - - edited

        Attached file patch (diff -u)

        Show
        Philippe Le Berre added a comment - - edited Attached file patch (diff -u)

          People

          • Assignee:
            Unassigned
            Reporter:
            Philippe Le Berre
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:

              Development