[ 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
