Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-3836

Missing output parameters in wrapped method implementations generate NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.6, 2.4.2
    • 2.3.8, 2.4.5, 2.5.1
    • JAX-WS Runtime
    • None
    • Unknown

    Description

      When implementing an interface generated from a WSDL which has an output parameter stored in a holder, as in

              @WebParam(mode = WebParam.Mode.OUT, name = "created", targetNamespace = "")
              javax.xml.ws.Holder<java.lang.Boolean> created
      

      Failing to provide a value in the supplied holder results in an NPE, originating from the runtime-generated WrapperTypeHelper class, e.g.

      java.lang.NullPointerException
      	at com.vindicia.soap.v3_6.account.UpdateResponse_WrapperTypeHelper1.createWrapperObject(Unknown Source)
      	at org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor.handleMessage(WrapperClassOutInterceptor.java:105)
      

      This fails to inform the user of the cause of the issue or how to diagnose it. Instead, required parameters should be validated to atleast be not null before they are assumed to have been provided.

      I have validated this behavior on 2.4.2, 2.4.0 and 2.3.6.

      The work-around for the user is of course to provide a non-null value in the holder object.

      It is worth noting this appears to only happen for output parameters that are normally mapped to primitive types.

      Attachments

        Activity

          People

            ffang Freeman Yue Fang
            tag@cpan.org Scott S. McCoy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: