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 "Herman (JIRA)" <ji...@apache.org> on 2006/10/24 14:06:18 UTC

[jira] Created: (AXIS2-1489) wsdl2java fires NullpointerException when using anonymous complex type

wsdl2java fires NullpointerException when using anonymous complex type
----------------------------------------------------------------------

                 Key: AXIS2-1489
                 URL: http://issues.apache.org/jira/browse/AXIS2-1489
             Project: Apache Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: wsdl
    Affects Versions: 1.0
         Environment: Windows XP, jdk1.5.0_06-b05
            Reporter: Herman


When I compile a WSDL that contains the following piece of xml:

	    <complexType name="transactionRecord">
	      <sequence>
			<element name="documentRefnr" type="types:documentRefnr"/>
			<element name="formType" type="types:formType"/>
		    <element name="accountDb" type="types:account"/>
		    <element name="accountCr" type="types:account"/>
		    <element name="amount" type="types:amount"/>
		    <element name="status" type="types:status"/>
		    <element name="error" type="types:error"/>
			<element name="dateCreated" type="dateTime"/>
			<element name="dateLastChange" type="dateTime"/>
	      </sequence>
	    </complexType>

[...]

	    <element name="TransactionData">
          <complexType>
            <sequence>
              <element name="TransactionRecord" maxOccurs="unbounded" minOccurs="0" type="types:transactionRecord"/>
            </sequence>
          </complexType>
        </element>

If I leave out the [name="TransactionRecord"]  in the last element (so it becomes anonimous), I get the following NullPointerException:

org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: org.apache.axis2.schema.SchemaCompilationException: java.lang.NullPointerException
	at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:185)
	at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
	at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
Caused by: java.lang.RuntimeException: org.apache.axis2.schema.SchemaCompilationException: java.lang.NullPointerException
	at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:117)
	at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:140)
	... 2 more
Caused by: org.apache.axis2.schema.SchemaCompilationException: java.lang.NullPointerException
	at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:186)
	at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:70)
	... 3 more
Caused by: java.lang.NullPointerException
	at org.apache.axis2.schema.SchemaCompiler.process(SchemaCompiler.java:967)
	at org.apache.axis2.schema.SchemaCompiler.processParticle(SchemaCompiler.java:878)
	at org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:643)
	at org.apache.axis2.schema.SchemaCompiler.processAnonymousComplexSchemaType(SchemaCompiler.java:594)
	at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:579)
	at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:366)
	at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:344)
	at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:226)
	at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:181)
	... 4 more
Exception in thread "main" 

------------------------------------
It seems a general bug - if you use anonymous elements, you'll get a NullPointerException in the SchemaCompiler.
My advice: NEVER EVER allow NullPointerExceptions! You can't even see at what line of the WSDL the compiler failed.
It took me quite some time to find the cause of this problem...


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-1489) wsdl2java fires NullpointerException when using anonymous complex type

Posted by "Herman (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-1489?page=comments#action_12444299 ] 
            
Herman commented on AXIS2-1489:
-------------------------------

PS. I opened this issue as major because I encountered NullpointerExceptions many times while trying axis2 (I'm a beginner on axis2).
To be honest, the wsdl2java tool seems not very stable/mature. Many times the compiler fails leaving the developer with no clue about why it failed. Please improve the output messages in case of failure. 

> wsdl2java fires NullpointerException when using anonymous complex type
> ----------------------------------------------------------------------
>
>                 Key: AXIS2-1489
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1489
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: wsdl
>    Affects Versions: 1.0
>         Environment: Windows XP, jdk1.5.0_06-b05
>            Reporter: Herman
>         Attachments: DocumentQueryService.wsdl
>
>
> When I compile a WSDL that contains the following piece of xml:
> 	    <complexType name="transactionRecord">
> 	      <sequence>
> 			<element name="documentRefnr" type="types:documentRefnr"/>
> 			<element name="formType" type="types:formType"/>
> 		    <element name="accountDb" type="types:account"/>
> 		    <element name="accountCr" type="types:account"/>
> 		    <element name="amount" type="types:amount"/>
> 		    <element name="status" type="types:status"/>
> 		    <element name="error" type="types:error"/>
> 			<element name="dateCreated" type="dateTime"/>
> 			<element name="dateLastChange" type="dateTime"/>
> 	      </sequence>
> 	    </complexType>
> [...]
> 	    <element name="TransactionData">
>           <complexType>
>             <sequence>
>               <element name="TransactionRecord" maxOccurs="unbounded" minOccurs="0" type="types:transactionRecord"/>
>             </sequence>
>           </complexType>
>         </element>
> If I leave out the [name="TransactionRecord"]  in the last element (so it becomes anonimous), I get the following NullPointerException:
> org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: org.apache.axis2.schema.SchemaCompilationException: java.lang.NullPointerException
> 	at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:185)
> 	at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
> 	at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> Caused by: java.lang.RuntimeException: org.apache.axis2.schema.SchemaCompilationException: java.lang.NullPointerException
> 	at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:117)
> 	at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:140)
> 	... 2 more
> Caused by: org.apache.axis2.schema.SchemaCompilationException: java.lang.NullPointerException
> 	at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:186)
> 	at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:70)
> 	... 3 more
> Caused by: java.lang.NullPointerException
> 	at org.apache.axis2.schema.SchemaCompiler.process(SchemaCompiler.java:967)
> 	at org.apache.axis2.schema.SchemaCompiler.processParticle(SchemaCompiler.java:878)
> 	at org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:643)
> 	at org.apache.axis2.schema.SchemaCompiler.processAnonymousComplexSchemaType(SchemaCompiler.java:594)
> 	at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:579)
> 	at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:366)
> 	at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:344)
> 	at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:226)
> 	at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:181)
> 	... 4 more
> Exception in thread "main" 
> ------------------------------------
> It seems a general bug - if you use anonymous elements, you'll get a NullPointerException in the SchemaCompiler.
> My advice: NEVER EVER allow NullPointerExceptions! You can't even see at what line of the WSDL the compiler failed.
> It took me quite some time to find the cause of this problem...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-1489) wsdl2java fires NullpointerException when using anonymous complex type

Posted by "Deepal Jayasinghe (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-1489?page=comments#action_12444296 ] 
            
Deepal Jayasinghe commented on AXIS2-1489:
------------------------------------------

can you please attached the wsdl.

> wsdl2java fires NullpointerException when using anonymous complex type
> ----------------------------------------------------------------------
>
>                 Key: AXIS2-1489
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1489
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: wsdl
>    Affects Versions: 1.0
>         Environment: Windows XP, jdk1.5.0_06-b05
>            Reporter: Herman
>         Attachments: DocumentQueryService.wsdl
>
>
> When I compile a WSDL that contains the following piece of xml:
> 	    <complexType name="transactionRecord">
> 	      <sequence>
> 			<element name="documentRefnr" type="types:documentRefnr"/>
> 			<element name="formType" type="types:formType"/>
> 		    <element name="accountDb" type="types:account"/>
> 		    <element name="accountCr" type="types:account"/>
> 		    <element name="amount" type="types:amount"/>
> 		    <element name="status" type="types:status"/>
> 		    <element name="error" type="types:error"/>
> 			<element name="dateCreated" type="dateTime"/>
> 			<element name="dateLastChange" type="dateTime"/>
> 	      </sequence>
> 	    </complexType>
> [...]
> 	    <element name="TransactionData">
>           <complexType>
>             <sequence>
>               <element name="TransactionRecord" maxOccurs="unbounded" minOccurs="0" type="types:transactionRecord"/>
>             </sequence>
>           </complexType>
>         </element>
> If I leave out the [name="TransactionRecord"]  in the last element (so it becomes anonimous), I get the following NullPointerException:
> org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: org.apache.axis2.schema.SchemaCompilationException: java.lang.NullPointerException
> 	at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:185)
> 	at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
> 	at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> Caused by: java.lang.RuntimeException: org.apache.axis2.schema.SchemaCompilationException: java.lang.NullPointerException
> 	at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:117)
> 	at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:140)
> 	... 2 more
> Caused by: org.apache.axis2.schema.SchemaCompilationException: java.lang.NullPointerException
> 	at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:186)
> 	at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:70)
> 	... 3 more
> Caused by: java.lang.NullPointerException
> 	at org.apache.axis2.schema.SchemaCompiler.process(SchemaCompiler.java:967)
> 	at org.apache.axis2.schema.SchemaCompiler.processParticle(SchemaCompiler.java:878)
> 	at org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:643)
> 	at org.apache.axis2.schema.SchemaCompiler.processAnonymousComplexSchemaType(SchemaCompiler.java:594)
> 	at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:579)
> 	at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:366)
> 	at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:344)
> 	at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:226)
> 	at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:181)
> 	... 4 more
> Exception in thread "main" 
> ------------------------------------
> It seems a general bug - if you use anonymous elements, you'll get a NullPointerException in the SchemaCompiler.
> My advice: NEVER EVER allow NullPointerExceptions! You can't even see at what line of the WSDL the compiler failed.
> It took me quite some time to find the cause of this problem...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-1489) wsdl2java fires NullpointerException when using anonymous complex type

Posted by "Herman (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2-1489?page=all ]

Herman updated AXIS2-1489:
--------------------------

    Attachment: DocumentQueryService.wsdl

Compile the attached file (I use options "-d adb -uri wsdl\DocumentQueryService.wsdl -ss -g -sd -o wsdl\output -p giroflow.docquery").
It will work.
Now edit the file and remove the [name="LEAVE_OUT_TO_GET_BUG"] part.
Compile again.
You'll get a NullpointerException

> wsdl2java fires NullpointerException when using anonymous complex type
> ----------------------------------------------------------------------
>
>                 Key: AXIS2-1489
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1489
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: wsdl
>    Affects Versions: 1.0
>         Environment: Windows XP, jdk1.5.0_06-b05
>            Reporter: Herman
>         Attachments: DocumentQueryService.wsdl
>
>
> When I compile a WSDL that contains the following piece of xml:
> 	    <complexType name="transactionRecord">
> 	      <sequence>
> 			<element name="documentRefnr" type="types:documentRefnr"/>
> 			<element name="formType" type="types:formType"/>
> 		    <element name="accountDb" type="types:account"/>
> 		    <element name="accountCr" type="types:account"/>
> 		    <element name="amount" type="types:amount"/>
> 		    <element name="status" type="types:status"/>
> 		    <element name="error" type="types:error"/>
> 			<element name="dateCreated" type="dateTime"/>
> 			<element name="dateLastChange" type="dateTime"/>
> 	      </sequence>
> 	    </complexType>
> [...]
> 	    <element name="TransactionData">
>           <complexType>
>             <sequence>
>               <element name="TransactionRecord" maxOccurs="unbounded" minOccurs="0" type="types:transactionRecord"/>
>             </sequence>
>           </complexType>
>         </element>
> If I leave out the [name="TransactionRecord"]  in the last element (so it becomes anonimous), I get the following NullPointerException:
> org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: org.apache.axis2.schema.SchemaCompilationException: java.lang.NullPointerException
> 	at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:185)
> 	at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
> 	at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> Caused by: java.lang.RuntimeException: org.apache.axis2.schema.SchemaCompilationException: java.lang.NullPointerException
> 	at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:117)
> 	at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:140)
> 	... 2 more
> Caused by: org.apache.axis2.schema.SchemaCompilationException: java.lang.NullPointerException
> 	at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:186)
> 	at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:70)
> 	... 3 more
> Caused by: java.lang.NullPointerException
> 	at org.apache.axis2.schema.SchemaCompiler.process(SchemaCompiler.java:967)
> 	at org.apache.axis2.schema.SchemaCompiler.processParticle(SchemaCompiler.java:878)
> 	at org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:643)
> 	at org.apache.axis2.schema.SchemaCompiler.processAnonymousComplexSchemaType(SchemaCompiler.java:594)
> 	at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:579)
> 	at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:366)
> 	at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:344)
> 	at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:226)
> 	at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:181)
> 	... 4 more
> Exception in thread "main" 
> ------------------------------------
> It seems a general bug - if you use anonymous elements, you'll get a NullPointerException in the SchemaCompiler.
> My advice: NEVER EVER allow NullPointerExceptions! You can't even see at what line of the WSDL the compiler failed.
> It took me quite some time to find the cause of this problem...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Resolved: (AXIS2-1489) wsdl2java fires NullpointerException when using anonymous complex type

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2-1489?page=all ]

Davanum Srinivas resolved AXIS2-1489.
-------------------------------------

    Resolution: Fixed

Applied a fix 

thanks,
dims

> wsdl2java fires NullpointerException when using anonymous complex type
> ----------------------------------------------------------------------
>
>                 Key: AXIS2-1489
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1489
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: wsdl
>    Affects Versions: 1.0
>         Environment: Windows XP, jdk1.5.0_06-b05
>            Reporter: Herman
>         Attachments: DocumentQueryService.wsdl
>
>
> When I compile a WSDL that contains the following piece of xml:
> 	    <complexType name="transactionRecord">
> 	      <sequence>
> 			<element name="documentRefnr" type="types:documentRefnr"/>
> 			<element name="formType" type="types:formType"/>
> 		    <element name="accountDb" type="types:account"/>
> 		    <element name="accountCr" type="types:account"/>
> 		    <element name="amount" type="types:amount"/>
> 		    <element name="status" type="types:status"/>
> 		    <element name="error" type="types:error"/>
> 			<element name="dateCreated" type="dateTime"/>
> 			<element name="dateLastChange" type="dateTime"/>
> 	      </sequence>
> 	    </complexType>
> [...]
> 	    <element name="TransactionData">
>           <complexType>
>             <sequence>
>               <element name="TransactionRecord" maxOccurs="unbounded" minOccurs="0" type="types:transactionRecord"/>
>             </sequence>
>           </complexType>
>         </element>
> If I leave out the [name="TransactionRecord"]  in the last element (so it becomes anonimous), I get the following NullPointerException:
> org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: org.apache.axis2.schema.SchemaCompilationException: java.lang.NullPointerException
> 	at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:185)
> 	at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
> 	at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> Caused by: java.lang.RuntimeException: org.apache.axis2.schema.SchemaCompilationException: java.lang.NullPointerException
> 	at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:117)
> 	at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:140)
> 	... 2 more
> Caused by: org.apache.axis2.schema.SchemaCompilationException: java.lang.NullPointerException
> 	at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:186)
> 	at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:70)
> 	... 3 more
> Caused by: java.lang.NullPointerException
> 	at org.apache.axis2.schema.SchemaCompiler.process(SchemaCompiler.java:967)
> 	at org.apache.axis2.schema.SchemaCompiler.processParticle(SchemaCompiler.java:878)
> 	at org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:643)
> 	at org.apache.axis2.schema.SchemaCompiler.processAnonymousComplexSchemaType(SchemaCompiler.java:594)
> 	at org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:579)
> 	at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:366)
> 	at org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:344)
> 	at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:226)
> 	at org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:181)
> 	... 4 more
> Exception in thread "main" 
> ------------------------------------
> It seems a general bug - if you use anonymous elements, you'll get a NullPointerException in the SchemaCompiler.
> My advice: NEVER EVER allow NullPointerExceptions! You can't even see at what line of the WSDL the compiler failed.
> It took me quite some time to find the cause of this problem...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org