JBossWS wsconsume error “undefined element declaration ‘sch:schema’”
March 4, 2009 – 4:18 pm by Stefano MAESTRIToday I was importing a .NET generated wsdl and getting this error using JBossWS wsconsume.sh tool (yes I’m not using Wise for this particular case!! But the problem would be the same in Wise since it use wsconsume under the hood) :
[WARNING] src-resolve.4.2: Error resolving component 'sch:schema'. It was detected that 'sch:schema' is in namespace 'http://www.w3.org/2001/XMLSchema', but components from this namespace are not referenceable from schema document 'file:/home/oracle/Desktop/security.asmx#types?schema1'. If this is the incorrect namespace, perhaps the prefix of 'sch:schema' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:/home/oracle/Desktop/security.asmx#types?schema1'. line 85 of file:/home/oracle/Desktop/security.asmx#types?schema1 [ERROR] undefined element declaration 'sch:schema' line 85 of file:/home/oracle/Desktop/security.asmx [ERROR] undefined element declaration 'sch:schema' line 178 of file:/home/oracle/Desktop/security.asmx [ERROR] undefined element declaration 'sch:schema' line 217 of file:/home/oracle/Desktop/security.asmx [ERROR] undefined element declaration 'sch:schema' line 231 of file:/home/oracle/Desktop/security.asmx [ERROR] undefined element declaration 'sch:schema' line 245 of file:/home/oracle/Desktop/security.asmx [ERROR] undefined element declaration 'sch:schema' line 259 of file:/home/oracle/Desktop/security.asmx [ERROR] undefined element declaration 'sch:schema' line 273 of file:/home/oracle/Desktop/security.asmx Failed to invoke WsImport java.lang.NullPointerException at com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet.apply(SCDBasedBindingSet.java:237) at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:518) at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:232) at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:85) at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:134) at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2244) at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:187) at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:133) at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:182) at org.jboss.ws.tools.jaxws.impl.SunRIConsumerImpl.consume(SunRIConsumerImpl.java:217) at org.jboss.wsf.spi.tools.cmd.WSConsume.importServices(WSConsume.java:223) at org.jboss.wsf.spi.tools.cmd.WSConsume.main(WSConsume.java:81)
After some search Alessio pointed me to this excellent post where the problem is well explained and solution provided. The “problem” is not specific to JBossWS and solution explained there is fine for JBossWS too.
Hoping this cross post could help someone looking for the error in relation to JBossWS in google












