views:

379

answers:

0

In the process of my daily work, I am trying to use the WSDL and XSD from this article:

http://www.ibm.com/developerworks/webservices/library/ws-restwsdl/

as a template from which to generate some java code. My desire is to use the generated java code to in some way validate that my (to be) hand-rolled WSDL and schema are reasonably sane. Problem is, when I run (something like):

...WSDL2Java --noBuildXML --unpack-classes -uri booklist.wsdl -wv 2.0

I get this exception:

 [java] Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
 [java]     at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:159)
 [java]     at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
 [java]     at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
 [java] Caused by: java.lang.NullPointerException
 [java]     at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.setFeature(Unknown Source)
 [java]     at org.apache.xerces.parsers.BasicParserConfiguration.<init>(BasicParserConfiguration.java:261)
 [java]     at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.<init>(Unknown Source)
 [java]     at org.apache.xerces.impl.xs.opti.SchemaParsingConfig.<init>(Unknown Source)
 [java]     at org.apache.xerces.impl.xs.traversers.XSDHandler.<init>(XSDHandler.java:340)
 [java]     at org.apache.xerces.impl.xs.traversers.XSDHandler.<init>(XSDHandler.java:347)
 [java]     at org.apache.xerces.impl.xs.XMLSchemaValidator.<init>(XMLSchemaValidator.java:1086)
 [java]     at org.apache.xerces.parsers.StandardParserConfiguration.configurePipeline(StandardParserConfiguration.java:673)
 [java]     at org.apache.xerces.parsers.StandardParserConfiguration.reset(StandardParserConfiguration.java:627)
 [java]     at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:502)
 [java]     at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:585)
 [java]     at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
 [java]     at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:221)
 [java]     at org.apache.woden.internal.DOMWSDLReader.getDocument(DOMWSDLReader.java:735)
 [java]     at org.apache.woden.internal.DOMWSDLReader.retrieveSchema(DOMWSDLReader.java:629)
 [java]     at org.apache.woden.internal.DOMWSDLReader.parseSchemaImport(DOMWSDLReader.java:380)
 [java]     at org.apache.woden.internal.BaseWSDLReader.parseTypes(BaseWSDLReader.java:573)
 [java]     at org.apache.woden.internal.BaseWSDLReader.parseDescription(BaseWSDLReader.java:429)
 [java]     at org.apache.woden.internal.DOMWSDLReader.readWSDL(DOMWSDLReader.java:185)
 [java]     at org.apache.woden.internal.DOMWSDLReader.readWSDL(DOMWSDLReader.java:158)
 [java]     at org.apache.axis2.description.WSDL20ToAxisServiceBuilder.readInTheWSDLFile(WSDL20ToAxisServiceBuilder.java:1225)
 [java]     at org.apache.axis2.description.WSDL20ToAxisServiceBuilder.readInTheWSDLFile(WSDL20ToAxisServiceBuilder.java:1176)
 [java]     at org.apache.axis2.description.WSDL20ToAxisServiceBuilder.<init>(WSDL20ToAxisServiceBuilder.java:153)
 [java]     at org.apache.axis2.description.WSDL20ToAllAxisServicesBuilder.<init>(WSDL20ToAllAxisServicesBuilder.java:53)
 [java]     at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:102)
 [java]     ... 2 more

Can I not generate the code from files merely sitting in the current directory? (I have done this before, but it was a WSDL 1.1 file which did not have external supporting schema files)

Is there a known problem with this example WSDL?

Is there a bug in Axis2 (version 1.5) WSDL2Java? (obviously, it would be nice to have an error message about some missing data, instead of the null pointer/reference throw up)