[prev in list] [next in list] [prev in thread] [next in thread]
List: xmlbeans-user
Subject: RE: NPE issue during compile time
From: "Radu Preotiuc-Pietro" <radup () bea ! com>
Date: 2008-04-23 20:00:15
Message-ID: BF6B6CA032BA0A429BD924F96765147DBF2E10 () repbex02 ! amer ! bea ! com
[Download RAW message or body]
The issue that you filed for this problem (XMLBEANS-360) has been
resolved.
Thanks,
Radu
________________________________
From: Jenny Qin [mailto:jqin@nortel.com]
Sent: Monday, April 21, 2008 8:47 AM
To: user@xmlbeans.apache.org
Subject: NPE issue during compile time
Hi,
I have encountered a NPE issue during compile time with the
following error:
>scomp -d class_xsb -src src -srconly -mx 500m datamodel.xsd
Time to build schema type system: 2.657 seconds Exception in
thread "main" java.lang.NullPointerException at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.writeType
Data(SchemaTypeSystemImpl.java:2872) at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveType(SchemaType
SystemImpl.java:1454) at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveTypesRecursivel
y(SchemaTypeSystemImpl.java:1331) at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveTypesRecursivel
y(SchemaTypeSystemImpl.java:1332) at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.save(SchemaTypeSyst
emImpl.java:1307) at
org.apache.xmlbeans.impl.tool.SchemaCompiler.compile(SchemaCompiler.java
> 1126) at
org.apache.xmlbeans.impl.tool.SchemaCompiler.main(SchemaCompiler.java:37
3)
The problem happens during a .xsd compile using scomp: after it
generated all the .xsb files and the schema type system generation is
said to have completed, then it failed I think while attempting to
create a "TypeSystemHolder.class".
I was able to pin point the issue to the syntax below ... which
seems to have caused a null SchemaStringEnumEntry[] while trying to
writeTypeData inside SchemaTypeSystemImpl.
As far as I can tell the syntax seems to be valid, I was able to
run it through a validator and was able to compile it in jaxb.
<xs:element name="XYZType">
<xs:complexType>
<xs:simpleContent>
<xs:restriction base="xs:anyType">
<xs:simpleType>
<xs:retriction base="xs:token">
<xs:enumeration value="abc"/>
<xs:enumeration value="def"/>
<xs:enumeration value="unknown"/>
</xs:restriction>
</xs:simpleType>
</xs:restriction>
</xs:simpleContent>
</xs:complexType>
</xs:element>
I have also noticed that if I change the above syntax to the
following then it would compile in XMLBeans
<xs:simpleType name = "XYZEnum">
<xs:retriction base="xs:token">
<xs:enumeration value="abc"/>
<xs:enumeration value="def"/>
<xs:enumeration value="unknown"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="XYZType">
<xs:complexType>
<xs:extension base="event: XYZEnum">
</xs:extension>
</xs:complexType>
</xs:element>
I believe the two are semantically the same. I don't understand
why one would compile while the other won't. Any suggestion/input would
be greatly appreciated.
Thanks,
Jenny
p.s. I am running the latest 2.3.0 release.
Notice: This email message, together with any attachments, may contain information \
of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be \
confidential, proprietary, copyrighted and/or legally privileged, and is intended \
solely for the use of the individual or entity named in this message. If you are not \
the intended recipient, and have received this message in error, please immediately \
return this by email and then delete it.
[Attachment #3 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3314" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=046385919-23042008><FONT face=Arial
color=#0000ff size=2>The issue that you filed for this problem
(XMLBEANS-360) has been resolved.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=046385919-23042008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=046385919-23042008><FONT face=Arial
color=#0000ff size=2>Thanks,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=046385919-23042008><FONT face=Arial
color=#0000ff size=2>Radu</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; \
MARGIN-RIGHT: 0px"> <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Jenny Qin [mailto:jqin@nortel.com]
<BR><B>Sent:</B> Monday, April 21, 2008 8:47 AM<BR><B>To:</B>
user@xmlbeans.apache.org<BR><B>Subject:</B> NPE issue during compile
time<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left>
<DIV><FONT face=Arial color=#0000ff size=2>Hi, <BR><BR>I have
encountered <SPAN class=827001114-21042008>a</SPAN> NPE issue during
compile time with the following error: <BR><BR>>scomp -d class_xsb -src src
-srconly -mx 500m datamodel.xsd <BR>Time to build schema type system: 2.657
seconds Exception in thread "main" java.lang.NullPointerException at
<BR>org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.writeTypeData(SchemaTypeSystemImpl.java:2872) at \
<BR>org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveType(SchemaTypeSystemImpl.java:1454) \
at
<BR>org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveTypesRecursively(SchemaTypeSystemImpl.java:1331) at \
<BR>org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveTypesRecursively(SchemaTypeSystemImpl.java:1332) at \
<BR>org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.save(SchemaTypeSystemImpl.java:1307) at \
<BR>org.apache.xmlbeans.impl.tool.SchemaCompiler.compile(SchemaCompiler.java:1126) at \
<BR>org.apache.xmlbeans.impl.tool.SchemaCompiler.main(SchemaCompiler.java:373)
<BR><BR>The problem happens during a .xsd compile using scomp: after it
generated all the .xsb files and the schema type system generation is said to
have completed, then <SPAN class=827001114-21042008>i</SPAN>t failed I
think while attempting to create a "TypeSystemHolder.class". </FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV>
<DIV class=action-body><FONT face=Arial color=#0000ff size=2>I was able to pin
point the issue to the syntax below ... which seems to <SPAN
class=827001114-21042008>have </SPAN>cause<SPAN
class=827001114-21042008>d</SPAN> a null SchemaStringEnumEntry[] while trying
to writeTypeData inside SchemaTypeSystemImpl. <BR><BR><SPAN
class=827001114-21042008>As far as I can tell </SPAN>the syntax<SPAN
class=827001114-21042008> seems to be</SPAN> valid, <SPAN
class=827001114-21042008>I was able to run it through a</SPAN> validator
and <SPAN class=827001114-21042008>was able to</SPAN> compile<SPAN
class=827001114-21042008> it in</SPAN><SPAN class=827001114-21042008>
jaxb</SPAN>.<BR><EM><FONT color=#000000><xs:element name="XYZType">
<BR> <xs:complexType>
<BR> <xs:simpleContent>
<BR> <xs:restriction
base="xs:anyType">
<BR> <xs:simpleType> \
<BR> <xs:retriction \
base="xs:token">
<BR> <xs:enumeration \
value="abc"/>
<BR> <xs:enumeration \
value="def"/>
<BR> <xs:enumeration \
value="unknown"/>
<BR> </xs:restriction> \
<BR> </xs:simpleType> \
<BR> </xs:restriction> \
<BR> </xs:simpleContent>
<BR> </xs:complexType>
<BR> </xs:element></FONT> <BR></EM></FONT></DIV>
<DIV id=comment-12562618-closed style="DISPLAY: none"><FONT face=Arial
color=#0000ff size=2></FONT> </DIV>
<DIV style="DISPLAY: none"><SPAN class=827001114-21042008><FONT face=Arial
color=#0000ff size=2>I have also noticed that if I change the above
syntax to the following then it would compile in XMLBeans</FONT></SPAN></DIV>
<DIV style="DISPLAY: none"><SPAN class=827001114-21042008><FONT face=Arial
size=2><EM><xs:simpleType name = "XYZEnum"></EM></FONT></SPAN></DIV>
<DIV style="DISPLAY: none"><SPAN class=827001114-21042008><FONT face=Arial
size=2><EM> <xs:retriction
base="xs:token"> <BR> <xs:enumeration \
value="abc"/> <BR> <xs:enumeration \
value="def"/> <BR> <xs:enumeration \
value="unknown"/> <BR> </xs:restriction> <BR></xs:simpleType> \
</EM></FONT></SPAN></DIV>
<DIV style="DISPLAY: none"><FONT face=Arial
size=2><EM></EM></FONT> </DIV>
<DIV style="DISPLAY: none"><SPAN class=827001114-21042008><FONT face=Arial
color=#0000ff size=2><EM><FONT color=#000000><xs:element
name="XYZType"> <BR> <xs:complexType> \
<BR> <xs:extension
base="event:
XYZEnum"> <BR> </xs:extension> <BR> </xs:complexType> \
<BR> </xs:element></FONT> </EM></FONT></SPAN></DIV>
<DIV style="DISPLAY: none"><FONT face=Arial color=#0000ff size=2><SPAN
class=827001114-21042008></SPAN></FONT> </DIV>
<DIV style="DISPLAY: none"><FONT face=Arial color=#0000ff size=2><SPAN
class=827001114-21042008>I believe the two are semantically the same. I don't
understand why one would compile while the other won't. Any
suggestion/input would be greatly appreciated.</SPAN></FONT></DIV>
<DIV style="DISPLAY: none"><FONT face=Arial color=#0000ff size=2><SPAN
class=827001114-21042008></SPAN></FONT> </DIV>
<DIV style="DISPLAY: none"><FONT size=+0><FONT face=Arial><FONT
color=#0000ff><FONT size=2>Thanks, <BR>Jenny<BR><SPAN
class=827001114-21042008>p.s. <SPAN class=827001114-21042008>I </SPAN>am
running the latest 2.3.0 release<SPAN class=827001114-21042008>. </SPAN>
</SPAN></FONT></FONT></FONT></FONT></DIV>
<DIV style="DISPLAY: none"><FONT
size=+0> </DIV></FONT></DIV></DIV></BLOCKQUOTE></BODY></HTML>
<br>
Notice: This email message, together with any attachments, may contain information \
of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be \
confidential, proprietary, copyrighted and/or legally privileged, and is intended \
solely for the use of the individual or entity named in this message. If you are not \
the intended recipient, and have received this message in error, please immediately \
return this by email and then delete it.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic