[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)&nbsp;has been resolved.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=046385919-23042008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</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&nbsp;<SPAN class=827001114-21042008>a</SPAN> NPE issue during 
  compile time with the following error: <BR><BR>&gt;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&nbsp;at 
  <BR>org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.writeTypeData(SchemaTypeSystemImpl.java:2872)&nbsp;at \
  <BR>org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveType(SchemaTypeSystemImpl.java:1454) \
  at 
  <BR>org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveTypesRecursively(SchemaTypeSystemImpl.java:1331)&nbsp;at \
  <BR>org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.saveTypesRecursively(SchemaTypeSystemImpl.java:1332)&nbsp;at \
  <BR>org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.save(SchemaTypeSystemImpl.java:1307)&nbsp;at \
  <BR>org.apache.xmlbeans.impl.tool.SchemaCompiler.compile(SchemaCompiler.java:1126)&nbsp;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&nbsp;<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>&nbsp;</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&nbsp;<SPAN 
  class=827001114-21042008>have </SPAN>cause<SPAN 
  class=827001114-21042008>d</SPAN> a null SchemaStringEnumEntry[] while trying 
  to writeTypeData inside SchemaTypeSystemImpl.&nbsp;<BR><BR><SPAN 
  class=827001114-21042008>As far as I can tell </SPAN>the syntax<SPAN 
  class=827001114-21042008> seems to be</SPAN>&nbsp;valid,&nbsp;<SPAN 
  class=827001114-21042008>I was able to run it through&nbsp;a</SPAN> validator 
  and&nbsp;<SPAN class=827001114-21042008>was able to</SPAN>&nbsp;compile<SPAN 
  class=827001114-21042008> it in</SPAN><SPAN class=827001114-21042008> 
  jaxb</SPAN>.<BR><EM><FONT color=#000000>&lt;xs:element name="XYZType"&gt; 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:complexType&gt; 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:simpleContent&gt; 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:restriction 
  base="xs:anyType"&gt; 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:simpleType&gt; \
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:retriction \
  base="xs:token"&gt; 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:enumeration \
  value="abc"/&gt; 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:enumeration \
  value="def"/&gt; 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:enumeration \
  value="unknown"/&gt; 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xs:restriction&gt; \
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xs:simpleType&gt; \
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xs:restriction&gt; \
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xs:simpleContent&gt; 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xs:complexType&gt; 
  <BR>&nbsp;&nbsp;&lt;/xs:element&gt;</FONT> <BR></EM></FONT></DIV>
  <DIV id=comment-12562618-closed style="DISPLAY: none"><FONT face=Arial 
  color=#0000ff size=2></FONT>&nbsp;</DIV>
  <DIV style="DISPLAY: none"><SPAN class=827001114-21042008><FONT face=Arial 
  color=#0000ff size=2>I&nbsp;have also&nbsp;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>&lt;xs:simpleType name = "XYZEnum"&gt;</EM></FONT></SPAN></DIV>
  <DIV style="DISPLAY: none"><SPAN class=827001114-21042008><FONT face=Arial 
  size=2><EM>&nbsp; &lt;xs:retriction 
  base="xs:token"&gt;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:enumeration \
  value="abc"/&gt;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:enumeration \
  value="def"/&gt;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:enumeration \
  value="unknown"/&gt;&nbsp;<BR>&nbsp;&nbsp;&lt;/xs:restriction&gt;&nbsp;<BR>&lt;/xs:simpleType&gt; \
  </EM></FONT></SPAN></DIV>
  <DIV style="DISPLAY: none"><FONT face=Arial 
size=2><EM></EM></FONT>&nbsp;</DIV>
  <DIV style="DISPLAY: none"><SPAN class=827001114-21042008><FONT face=Arial 
  color=#0000ff size=2><EM><FONT color=#000000>&lt;xs:element 
  name="XYZType"&gt;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:complexType&gt; \
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:extension 
  base="event: 
  XYZEnum"&gt;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xs:extension&gt;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xs:complexType&gt; \
  <BR>&nbsp;&nbsp;&lt;/xs:element&gt;</FONT> </EM></FONT></SPAN></DIV>
  <DIV style="DISPLAY: none"><FONT face=Arial color=#0000ff size=2><SPAN 
  class=827001114-21042008></SPAN></FONT>&nbsp;</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&nbsp;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>&nbsp;</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&nbsp;</SPAN>am 
  running the latest 2.3.0 release<SPAN class=827001114-21042008>.&nbsp;</SPAN> 
  </SPAN></FONT></FONT></FONT></FONT></DIV>
  <DIV style="DISPLAY: none"><FONT 
size=+0>&nbsp;</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