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

NullPointerException from wsdl2java with no explanation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.3
    • 2.1.7, 2.2.4
    • None
    • None

    Description

      I had asked about this on the cxf-users mailing list, and was told to enter it into JIRA:

      -------

      I am trying to generate Java code using CXF to work with a third-party tool which they provide as a web service. I have attached the WSDL for their service to this message. When I try to run the wsdl2java tool on it (using either CXF 2.0.5, which we've used before, and currently use for one other project, or with 2.2.3, which I downloaded when I started having problems), I get a NullPointerException with no useful error message:

      jrobins@yggdrasil,11:10am,/tmp/newcxf/apache-cxf-2.2.3/bin% ./wsdl2java -d /tmp/harcourt -client -verbose /tmp/harcourt/HarcourtWS.wsdl
      Loading FrontEnd jaxws ...
      Loading DataBinding jaxb ...
      wsdl2java -d /tmp/harcourt -client -verbose /tmp/harcourt/HarcourtWS.wsdl
      wsdl2java - Apache CXF 2.2.3

      WSDLToJava Error: java.lang.NullPointerException

      org.apache.cxf.tools.common.ToolException: java.lang.NullPointerException
      at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:271)
      at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
      at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
      at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
      at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
      Caused by: java.lang.NullPointerException
      at org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.FaultProcessor.processFault(FaultProcessor.java:96)
      at org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.FaultProcessor.process(FaultProcessor.java:54)
      at org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.OperationProcessor.process(OperationProcessor.java:66)
      at org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.PortTypeProcessor.process(PortTypeProcessor.java:143)
      at org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.WSDLToJavaProcessor.wsdlDefinitionToJavaModel(WSDLToJavaProcessor.java:88)
      at org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.WSDLToJavaProcessor.process(WSDLToJavaProcessor.java:60)
      at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:229)
      at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:127)
      at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:263)
      ... 4 more

      There is no indication here as to what the problem is, and searching the web and the users@cxf archives, I don't find anything that seems related to this error.

      When I try running with -validate to see if the WSDL is valid, it gives me the following error:

      jrobins@yggdrasil,11:17am,/tmp/newcxf/apache-cxf-2.2.3/bin% ./wsdl2java -d /tmp/harcourt -validate -verbose /tmp/harcourt/HarcourtWS.wsdl
      Loading FrontEnd jaxws ...
      Loading DataBinding jaxb ...
      wsdl2java -d /tmp/harcourt -validate -verbose /tmp/harcourt/HarcourtWS.wsdl
      wsdl2java - Apache CXF 2.2.3

      WSDLToJava Error: WSI-BP-1.0 R2205 violation: In Message SubmitRequestFault, part ExceptionId must specify a 'element' attribute

      org.apache.cxf.tools.common.ToolException: WSI-BP-1.0 R2205 violation: In Message SubmitRequestFault, part ExceptionId must specify a 'element' attribute

      at org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:140)
      at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:201)
      at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:61)
      at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:166)
      at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:127)
      at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:263)
      at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
      at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
      at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
      at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)

      So it seems like there is an issue with conforming to the WS-I Basic Profile. However, I was under the impression that conforming to the BP was optional, and that a WSDL can still be valid even if it does not conform. I am sort of assuming that CXF is providing this message as informational, rather than as a requirement, but I don't know. Is it possible that this violation is what's causing the NullPointerException? And since this WSDL seems to be valid WSDL, even if it doesn't conform to the Basic Profile (it passes the validation at http://www.validwsdl.com/, for example), is there a way to get CXF not to require that it conform, and still generate Java client code? Since this is a third-party tool, we don't have the option of changing the WSDL or the service, so I'm hoping I can find a way to make this work.

      -------

      I will attach a copy of the WSDL file we're using.

      Attachments

        1. HarcourtWS.wsdl
          2 kB
          Joe Robins

        Activity

          People

            dkulp Daniel Kulp
            jmrobins Joe Robins
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: