axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shameera Rathnayaka (Updated) (JIRA)" <>
Subject [jira] [Updated] (AXIS2-4918) NPE during wsdl2java
Date Fri, 21 Oct 2011 15:30:32 GMT


Shameera Rathnayaka updated AXIS2-4918:

    Attachment: AXIS2-4918.patch

Hi Shao, 

In your wsdl you have an element call 'query' in both
and 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 schema it return true for
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

in ReportQuery schema

<s:element name="query">

***************change abve segment to 

<s:element name="query" type="s2:testQuery" />
<s:complexType name="testQuery">

This is because axis2 doesn't support when ref element has an anonymous ComplexType. I have
created improvement issue[1] for that. 


> NPE during wsdl2java
> --------------------
>                 Key: AXIS2-4918
>                 URL:
>             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/ -uri <wsdl file path> -s -or -uw
> and got NPE
> Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException:
>         at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(
>         at org.apache.axis2.wsdl.WSDL2Code.main(
>         at org.apache.axis2.wsdl.WSDL2Java.main(
> Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
>         at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(
>         at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(
>         ... 2 more
> Caused by: java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>         at java.lang.reflect.Method.invoke(
>         at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(
>         ... 3 more
> Caused by: java.lang.NullPointerException
>         at org.apache.axis2.schema.ExtensionUtility.populateClassName(
>         at org.apache.axis2.schema.ExtensionUtility.processSchemaSequence(
>         at org.apache.axis2.schema.ExtensionUtility.processXMLSchemaComplexType(
>         at org.apache.axis2.schema.ExtensionUtility.walkSchema(
>         at org.apache.axis2.schema.ExtensionUtility.invoke(
>         ... 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:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message