Just an addition to this I have set the
<parameter name="useOriginalwsdl">true</parameter in the service.xml file and I can see my own wsdl file but when I generate the code at the client site it throws the exception as described below. Now if I do not set this value I can generate the stubs and interestingly I see that in the automatically generated wsdl <xs:import namespace="http://common.ws.gryphonnetworks.com/xsd" schemaLocation="CertifyChannel?xsd=xsd0" /> Is shown Whereas in the actual one it is <xs:import namespace="http://common.ws.gryphonnetworks.com/xsd" schemaLocation="common.xsd" /> Why does the code generator changes this? Thanks Vibhor ________________________________ From: Vibhor_Sharma [mailto:[EMAIL PROTECTED] Sent: Friday, March 23, 2007 4:35 PM To: axis-user@ws.apache.org Subject: Unable to resolve schema errro during code generation Null pointer exception Importance: High Hi I get a Null pointer exception when I try to generate code using wsdl2java for stubs. I have a WSDL file which I refactored and moved common used data types to a common schema (common.xsd) which I import in the main WSDL file. I'm able to generate the server side code and deploy the service successfully. I could see this through the axis admin console. I have packaged the required common schema with the WSD file itself in the aar file. After deploying the service I can see my WSDL file also http://localhost:8080/axis2/services/CertifyChannel?wsdl. Now when I try to generate the code I get the following error. Is there any specific place I have to place the common.xsd that I have generated? [java] Retrieving schema at 'common.xsd', relative to 'http://localhost:8080/axis2/services/Cer tifyChannel?wsdl'. [java] Mar 23, 2007 4:26:00 PM org.apache.axis2.description.WSDL11ToAxisServiceBuilder populate Service [java] SEVERE: java.lang.RuntimeException: java.lang.NullPointerException [java] org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL [java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:180) [java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:710) [java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:178) [java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:84) [java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) [java] at org.apache.tools.ant.Task.perform(Task.java:364) [java] at org.apache.tools.ant.Target.execute(Target.java:341) [java] at org.apache.tools.ant.Target.performTasks(Target.java:369) [java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) [java] at org.apache.tools.ant.Project.executeTarget(Project.java:1185) [java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecut or.java:4 0) [java] at org.apache.tools.ant.Project.executeTargets(Project.java:1068) [java] at org.apache.tools.ant.Main.runBuild(Main.java:668) [java] at org.apache.tools.ant.Main.startAnt(Main.java:187) [java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246) [java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67) [java] Caused by: org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL [java] at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration Engine.ja va:112) [java] at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32) [java] at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java :25) [java] at java.lang.reflect.Method.invoke(Method.java:585) [java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:202) [java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:134) [java] ... 15 more [java] Caused by: org.apache.axis2.AxisFault: java.lang.NullPointerException; nested exception is: [java] java.lang.RuntimeException: java.lang.NullPointerException [java] at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService( WSDL11ToA xisServiceBuilder.java:250) [java] at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration Engine.ja va:103) [java] ... 23 more [java] Caused by: java.lang.RuntimeException: java.lang.NullPointerException [java] at org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilde r.java:18 08) [java] at org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilde r.java:18 20) [java] at org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.ja va:1552) [java] at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(Schema Builder.j ava:156) [java] at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollectio n.java:31 5) [java] at org.apache.axis2.description.WSDLToAxisServiceBuilder.getXMLSchema(WSDLT oAxisServ iceBuilder.java:132) [java] at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.copyExtensibleEl ements(WS DL11ToAxisServiceBuilder.java:1719) [java] at org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService( WSDL11ToA xisServiceBuilder.java:214) [java] ... 24 more [java] Caused by: java.lang.NullPointerException [java] at org.apache.ws.commons.schema.SchemaBuilder$1.validate(SchemaBuilder.java :1534) [java] at org.apache.ws.commons.schema.SchemaBuilder.setNamespaceAttributes(Schema Builder.j ava:283) [java] at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(Schema Builder.j ava:78) [java] at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:67) [java] at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollectio n.java:32 5) [java] at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollectio n.java:27 2) [java] at org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilde r.java:18 06)