[ https://issues.apache.org/jira/browse/CXF-7787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16541493#comment-16541493 ]
Colm O hEigeartaigh commented on CXF-7787: ------------------------------------------ I'll fix the NPE. It is actually caused by the empty "import" statement in the first schema. However, your schemas are malformed - if you remove the empty import statement you get the following error: WSDLToJava Error: Schema Error : src-resolve.4.1: Error resolving component 'GetLabs_Request'. It was detected that 'GetLabs_Request' has no namespace, but components with no target namespace are not referenceable from schema document 'file:/home/coheig/dist/apache/apache-cxf-3.2.5/LabResultsService.singleWsdl#types1'. If 'GetLabs_Request' is intended to have a namespace, perhaps a prefix needs to be provided. If it is intended that 'GetLabs_Request' has no namespace, then an 'import' without a "namespace" attribute should be added to 'file:/home/coheig/dist/apache/apache-cxf-3.2.5/LabResultsService.singleWsdl#types1'. > NullPointerException from wsdl2java > ----------------------------------- > > Key: CXF-7787 > URL: https://issues.apache.org/jira/browse/CXF-7787 > Project: CXF > Issue Type: Test > Environment: CXF 3.2.5 > Java 8 > Reporter: James Main > Assignee: Colm O hEigeartaigh > Priority: Major > Fix For: 3.2.6 > > Attachments: LabResultsService.singleWsdl > > > I am trying to generate Java code against my wsdl file using the wsdl2java > utility. I can't figure out where I am going wrong. > Here is the command line arguments I am using --> > $ ./wsdl2java.bat -d /c/Users/jmain/generated -client -exsh false -dns true > -dex true -validate -verbose > /c/Users/jmain/workspace-hub-hhcc/hub/src/main/resources/wsdl/hhcc/LabResultsService.singleWsdl > > And here is the output --> > Loading FrontEnd jaxws ... > Loading DataBinding jaxb ... > wsdl2java -d C:/Users/jmain/generated -client -exsh false -dns true -dex true > -validate -verbose > C:/Users/jmain/workspace-hub-hhcc/hub/src/main/resources/wsdl/hhcc/LabResultsService.singleWsdl > wsdl2java - Apache CXF 3.2.5 > WSDLToJava Error: java.lang.NullPointerException > org.apache.cxf.tools.common.ToolException: java.lang.NullPointerException > at > org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:420) > at > org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:105) > 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:185) > Caused by: java.lang.NullPointerException > at > org.apache.cxf.common.xmlschema.SchemaCollection.getSchemaByTargetNamespace(SchemaCollection.java:164) > at > org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding$3.resolveResource(JAXBDataBinding.java:991) > at > com.sun.org.apache.xerces.internal.util.DOMEntityResolverWrapper.resolveEntity(DOMEntityResolverWrapper.java:117) > at > com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntity(XMLEntityManager.java:1081) > at > com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.resolveDocument(XMLSchemaLoader.java:657) > at > com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.resolveSchema(XSDHandler.java:2056) > at > com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(XSDHandler.java:1012) > at > com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:623) > at > com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:613) > at > com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:572) > at > com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:538) > at > com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.newSchema(XMLSchemaFactory.java:255) > at > javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:638) > at > org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.validateSchema(JAXBDataBinding.java:1006) > at > org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.addSchemasForServiceInfos(JAXBDataBinding.java:729) > at > org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.addSchemas(JAXBDataBinding.java:712) > at > org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:441) > at > org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:723) > at > org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:267) > at > org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:164) > at > org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:412) > ... 4 more > I've attached the WSDL file. > Any ideas? -- This message was sent by Atlassian JIRA (v7.6.3#76005)