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

wsdl2java - NPE when wsdl has a missing attribute

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.3
    • Fix Version/s: 2.1.4
    • Component/s: Tooling
    • Labels:
      None
    • Environment:

      MaxOS X, CXF 2.13, Camel 1.5.0

      Description

      I was working on part-five to a longer tutorial using Camel and CXF
      http://activemq.apache.org/camel/tutorial-example-reportincident-part5.html

      I have a handcrafted .wsdl which I use the wsdl2java tool to generate source code.

      I was getting this error reported from wsdl2java

      Jan 11, 2009 3:43:10 PM org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory createEndpoint
      WARNING: Could not find endpoint/port for {http://reportincident.example.camel.apache.org}ReportIncidentEndpointPort in wsdl. Using {http://reportincident.example.camel.apache.org}ReportIncidentPort.
      

      So I was messing a bit with the .wsdl to see what was wrong

      How to reproduce
      1) Download the .zip from: http://cwiki.apache.org/confluence/display/CAMEL/Tutorial-Example-ReportIncident-Part5
      2) Unzip to a folder
      3) Run: mvn test it should run fine
      4) Edit the file: src/main/resources/report_incident.wsdl
      5) Change from

      <wsdl:binding name="ReportIncidentBinding" type="tns:ReportIncidentEndpoint">
      

      to remove the type attribute (yes I was being a bit mean), so its

      <wsdl:binding name="ReportIncidentBinding">
      

      6) Save
      7) Run: mvn test again and see the error

      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] java.lang.NullPointerException
      

      The problem is the NPE doesnt give you any hint what was wrong. What if the .wsdl was very large and you didn't have a clue what was wrong with it.

        Attachments

          Activity

            People

            • Assignee:
              seanoc Sean O'Callaghan
              Reporter:
              davsclaus Claus Ibsen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: