[ https://issues.apache.org/jira/browse/WSCOMMONS-533?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benson Margulies updated WSCOMMONS-533: --------------------------------------- Fix Version/s: XmlSchema 1.4.6 > NullPointerException processing schema > -------------------------------------- > > Key: WSCOMMONS-533 > URL: https://issues.apache.org/jira/browse/WSCOMMONS-533 > Project: WS-Commons > Issue Type: Bug > Components: XmlSchema > Affects Versions: XmlSchema 1.4.5 > Reporter: Brian McDonald > Fix For: XmlSchema 1.4.6 > > > When processing a imported schema without a targetnamespace (where the import > had a namespace defined) you hit this exception: > [] java.lang.RuntimeException: java.lang.NullPointerException > [] at > org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.java:1907) > [] at > org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:1615) > [] at > org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:224) > [] at > org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:505) > [] at > com.itko.lisa.ws.nx.WSDLSchemaUtils.processTypes(WSDLSchemaUtils.java:2142) > [] at > com.itko.lisa.ws.nx.WSDLSchemaUtils.processWsdlDefsForSchemas(WSDLSchemaUtils.java:2092) > [] at > com.itko.lisa.ws.nx.WSDLSchemaUtils.processWsdlSchema(WSDLSchemaUtils.java:2081) > [] at > com.itko.lisa.ws.nx.WSDLSchemaUtils.processWsdlSchema(WSDLSchemaUtils.java:2060) > [] at > com.itko.lisa.ws.nx.ui.NxWSStepEditor.processNewWSDL(NxWSStepEditor.java:433) > [] at > com.itko.lisa.ws.nx.ui.ConnectionInfoEditor$30.run(ConnectionInfoEditor.java:940) > [] Caused by: java.lang.NullPointerException > [] at > org.apache.ws.commons.schema.SchemaBuilder$1.validate(SchemaBuilder.java:1602) > [] at > org.apache.ws.commons.schema.SchemaBuilder.setNamespaceAttributes(SchemaBuilder.java:369) > [] at > org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:134) > [] at > org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:121) > [] at > org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:491) > [] at > org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:364) > [] at > org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.java:1901) > [] ... 9 more > It is caused by this line in SchemaBuilder: > if (isEmpty(uri)) { > valid = > isEmpty(pSchema.syntacticalTargetNamespace); > } else { > valid = > pSchema.syntacticalTargetNamespace.equals(uri); // <===== > } > Simply inverting the equals will solve the problem > valid = > uri.equals(pSchema.syntacticalTargetNamespace); // <===== -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.