You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Shameera Rathnayaka (Updated) (JIRA)" <ji...@apache.org> on 2011/10/21 17:30:32 UTC
[jira] [Updated] (AXIS2-4918) NPE during wsdl2java
[ https://issues.apache.org/jira/browse/AXIS2-4918?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shameera Rathnayaka updated AXIS2-4918:
---------------------------------------
Attachment: AXIS2-4918.patch
Hi Shao,
In your wsdl you have an element call 'query' in both http://comscore.com/PlanTargetQuery and http://comscore.com/ReportQuery targetnamespaces. But isComponetExists(XmlSchema schema,QName componentQName,int componetType) {....} method in SchemaCompiler class doesn't check schema targetnamespace with component namespaceURI. Therefore even component element(query) from the http://comscore.com/ReportQuery schema it return true for http://comscore.com/PlanTargetQuery schema as it only checks localpart of component element. i have attached a patch for this.
After adding this patch you will encounter same problem again.But due to another reason.Therefore successfully generate all classes you have to change your wsdl to some extend i have show it
below
in ReportQuery schema
<s:element name="query">
<s:complexType>
......
</s:complexType>
</s:element>
***************change abve segment to
<s:element name="query" type="s2:testQuery" />
<s:complexType name="testQuery">
......
</s:complexType>
This is because axis2 doesn't support when ref element has an anonymous ComplexType. I have created improvement issue[1] for that.
[1]https://issues.apache.org/jira/browse/AXIS2-5169
Thanks
Shameera
> NPE during wsdl2java
> --------------------
>
> Key: AXIS2-4918
> URL: https://issues.apache.org/jira/browse/AXIS2-4918
> Project: Axis2
> Issue Type: Bug
> Components: adb
> Affects Versions: 1.5.4
> Environment: linux and windows
> Reporter: Hai Shao
> Priority: Critical
> Attachments: AXIS2-4918.patch
>
>
> Running wsdl2java as:
> sh $AXIS2_HOME/bin/wsdl2java.sh -uri <wsdl file path> -s -or -uw
> and got NPE
> Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
> at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:271)
> at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
> at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
> Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
> at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:53)
> at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224)
> ... 2 more
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:50)
> ... 3 more
> Caused by: java.lang.NullPointerException
> at org.apache.axis2.schema.ExtensionUtility.populateClassName(ExtensionUtility.java:521)
> at org.apache.axis2.schema.ExtensionUtility.processSchemaSequence(ExtensionUtility.java:468)
> at org.apache.axis2.schema.ExtensionUtility.processXMLSchemaComplexType(ExtensionUtility.java:349)
> at org.apache.axis2.schema.ExtensionUtility.walkSchema(ExtensionUtility.java:321)
> at org.apache.axis2.schema.ExtensionUtility.invoke(ExtensionUtility.java:168)
> ... 8 more
> wsdl file was validated.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org