[ http://jira.codehaus.org/browse/JIBX-312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dennis Sosnoski resolved JIBX-312. ---------------------------------- Assignee: Dennis Sosnoski Resolution: Fixed Fix Version/s: JiBX 1.2.2 The 1.2.1 code had several issues in handling non-namespaced schemas, including this NPE. Fixed the code generation for non-namespaced schemas and verified it now works with the sample schema. > Nullpointer exception trying to generate code > --------------------------------------------- > > Key: JIBX-312 > URL: http://jira.codehaus.org/browse/JIBX-312 > Project: JiBX > Issue Type: Bug > Components: CodeGen > Affects Versions: JiBX 1.2.1 > Environment: Windows > Reporter: Eric Nieuwenhuis > Assignee: Dennis Sosnoski > Fix For: JiBX 1.2.2 > > > I'm trying to generate code using CodeGen but I get a NullPointer exception. > I use the following command on Windows: > > java -cp c:\Java\Projects\jibx\lib\jibx-tools.jar > > org.jibx.schema.codegen.CodeGen "jibx.xsd" > which gets me the following stack trace: > Loaded and validated 1 specified schema(s) > Exception in thread "main" java.lang.NullPointerException > at > org.jibx.schema.codegen.ClassHolder$DataNode.<init>(ClassHolder.java:815) > at > org.jibx.schema.codegen.ClassHolder$LeafNode.<init>(ClassHolder.java:1235) > at > org.jibx.schema.codegen.StructureClassHolder.addToTree(StructureClassHolder.java:281) > at > org.jibx.schema.codegen.StructureClassHolder.addToTree(StructureClassHolder.java:214) > at > org.jibx.schema.codegen.StructureClassHolder.buildDataStructure(StructureClassHolder.java:309) > at org.jibx.schema.codegen.CodeGen.generate(CodeGen.java:1383) > at org.jibx.schema.codegen.CodeGen.main(CodeGen.java:1652) > The error can be reproduced using the following XSD: > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> > <xs:element name="elementA" type="aType"></xs:element> > <xs:complexType name="aType"> > <xs:sequence> > <xs:element ref="elementA" minOccurs="0" > maxOccurs="unbounded"/> > </xs:sequence> > </xs:complexType> > </xs:schema> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ jibx-devs mailing list jibx-devs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-devs