You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Jenny Qin <jq...@nortel.com> on 2008/04/21 17:47:27 UTC

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.  
 

RE: NPE issue during compile time

Posted by Jenny Qin <jq...@nortel.com>.
Many thanks.
 
Cheers,
Jenny

________________________________

From: Radu Preotiuc-Pietro [mailto:radup@bea.com] 
Sent: Wednesday, April 23, 2008 4:00 PM
To: user@xmlbeans.apache.org
Subject: RE: NPE issue during compile time


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.

RE: NPE issue during compile time

Posted by Jenny Qin <jq...@nortel.com>.
Thanks Radu.
 
What's the easiest way to pickup the fix? I have tried to pick up the
patch by downloading the actual files and manually added them into
official 2.3.0 source files and tried to build using ant. But it failed.

 
Here is the error output I have received ...

	
	U:\xmlbeans-2.3.0>ant
	Buildfile: build.xml
	dirs:
	version:
	     [echo] Trying to get revision number from Subversion...
	     [exec] Execute failed: java.io.IOException: CreateProcess:
svn info U:\xmlbeans-2.3.0 error=2
	     [echo] Apache XmlBeans version 2.3.0-unknown
	xmlinputstream.classes:
	jsr173-bundle.downloaded:
	jsr173-bundle.jar:
	jsr173_1.0.jars.extracted:
	jsr173_1.0.jars:
	xmlpublic.classes:
	    [javac] Compiling 109 source files to
U:\xmlbeans-2.3.0\build\classes\xmlpublic
	    [javac]
U:\xmlbeans-2.3.0\src\xmlpublic\org\apache\xmlbeans\XmlOptionsBean.java:
1: 'class' or 'interface' expected
	    [javac] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
	    [javac] ^
	    [javac]
U:\xmlbeans-2.3.0\src\xmlpublic\org\apache\xmlbeans\XmlOptionsBean.java:
8: 'class' or 'interface' expected
	    [javac] import org.xml.sax.XMLReader;
	    [javac] ^
	    [javac]
U:\xmlbeans-2.3.0\src\xmlpublic\org\apache\xmlbeans\XmlOptionsBean.java:
9: 'class' or 'interface' expected
	    [javac] import org.xml.sax.EntityResolver;
	    [javac] ^
	    [javac]
U:\xmlbeans-2.3.0\src\xmlpublic\org\apache\xmlbeans\XmlOptionsBean.java:
11: 'class' or 'interface' expected
	    [javac] import javax.xml.namespace.QName;
	    [javac] ^
	    [javac]
U:\xmlbeans-2.3.0\src\xmlpublic\org\apache\xmlbeans\XmlOptionsBean.java:
12: 'class' or 'interface' expected
	    [javac] import java.util.Map;
	    [javac] ^
	    [javac]
U:\xmlbeans-2.3.0\src\xmlpublic\org\apache\xmlbeans\XmlOptionsBean.java:
13: 'class' or 'interface' expected
	    [javac] import java.util.Set;
	    [javac] ^
	    [javac]
U:\xmlbeans-2.3.0\src\xmlpublic\org\apache\xmlbeans\XmlOptionsBean.java:
438: 'class' or 'interface' expected
	    [javac] </PRE></BODY></HTML>
	    [javac] ^
	    [javac] 7 errors
	BUILD FAILED
	U:\xmlbeans-2.3.0\build.xml:505: Compile failed; see the
compiler error output for details.
	Total time: 6 seconds
	 

Am I doing something wrong? 
 
Is there a better way to get the latest executable (e.g. as a tar file)
without doing the build myself? Many thanks.
 
Cheers,
Jenny



________________________________

From: Radu Preotiuc-Pietro [mailto:radup@bea.com] 
Sent: Wednesday, April 23, 2008 4:00 PM
To: user@xmlbeans.apache.org
Subject: RE: NPE issue during compile time


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.

RE: NPE issue during compile time

Posted by Radu Preotiuc-Pietro <ra...@bea.com>.
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.