wsdl2java - NPE when wsdl has a missing attribute -------------------------------------------------
Key: CXF-1969 URL: https://issues.apache.org/jira/browse/CXF-1969 Project: CXF Issue Type: Bug Components: Tooling Affects Versions: 2.1.3 Environment: MaxOS X, CXF 2.13, Camel 1.5.0 Reporter: Claus Ibsen Priority: Minor 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 {code} 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. {code} 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 {code} <wsdl:binding name="ReportIncidentBinding" type="tns:ReportIncidentEndpoint"> {code} to remove the type attribute (yes I was being a bit mean), so its {code} <wsdl:binding name="ReportIncidentBinding"> {code} 6) Save 7) Run: mvn test again and see the error {code} [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] java.lang.NullPointerException {code} 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. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.