You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Andrew Fleet <an...@iona.com> on 2003/04/26 02:21:54 UTC

XMLGrammarBuilder NullPointerException

Hi,
  this may be a simple usage issue, but I'm trying to use XMLGrammarBuilder
for validation of an instance document against a schema. I'm using the
following
command;

java xni.XMLGrammarBuilder -a name.xsd -i name.xml

and get,

C:\XMLSchema>java xni.XMLGrammarBuilder -a name.xsd -i name.xml
java.lang.NullPointerException
        at
org.apache.xerces.parsers.IntegratedParserConfiguration.configurePipe
line(Unknown Source)
        at org.apache.xerces.parsers.DTDConfiguration.reset(Unknown Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at xni.XMLGrammarBuilder.main(Unknown Source)

Any thoughts?

Platform Windows 2000, JDK 1.4.1_02, xerces Version 2.4, xsd and xml files
below,

Thanks,

Andy

C:\XMLSchema>type name.xsd
<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns:xs = "http://www.w3.org/2001/XMLSchema">
<xs:element name = "Name">
<xs:complexType>
<xs:sequence>
<xs:element name = "firstName" type = "xs:string" minOccurs = "0"/>
<xs:element name = "middleName" type = "xs:string" />
<xs:element name = "lastName" type = "xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>



C:\XMLSchema>type name.xml
<?xml version = "1.0" encoding = "UTF-8"?>
<Name xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="name.xsd">
<firstName>John</firstName>
<middleName>C</middleName>
<lastName>Fleet</lastName>



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: XMLGrammarBuilder NullPointerException

Posted by "K. Venugopal" <k....@sun.com>.
Hi Andy ,

I am not getting null pointer exception with latest code in CVS. It 
seems problem is fixed .

Regards
venu

Andrew Fleet wrote:

>Hi,
>  this may be a simple usage issue, but I'm trying to use XMLGrammarBuilder
>for validation of an instance document against a schema. I'm using the
>following
>command;
>
>java xni.XMLGrammarBuilder -a name.xsd -i name.xml
>
>and get,
>
>C:\XMLSchema>java xni.XMLGrammarBuilder -a name.xsd -i name.xml
>java.lang.NullPointerException
>        at
>org.apache.xerces.parsers.IntegratedParserConfiguration.configurePipe
>line(Unknown Source)
>        at org.apache.xerces.parsers.DTDConfiguration.reset(Unknown Source)
>        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
>        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
>        at xni.XMLGrammarBuilder.main(Unknown Source)
>
>Any thoughts?
>
>Platform Windows 2000, JDK 1.4.1_02, xerces Version 2.4, xsd and xml files
>below,
>
>Thanks,
>
>Andy
>
>C:\XMLSchema>type name.xsd
><?xml version = "1.0" encoding = "UTF-8"?>
><xs:schema xmlns:xs = "http://www.w3.org/2001/XMLSchema">
><xs:element name = "Name">
><xs:complexType>
><xs:sequence>
><xs:element name = "firstName" type = "xs:string" minOccurs = "0"/>
><xs:element name = "middleName" type = "xs:string" />
><xs:element name = "lastName" type = "xs:string" />
></xs:sequence>
></xs:complexType>
></xs:element>
></xs:schema>
>
>
>
>C:\XMLSchema>type name.xml
><?xml version = "1.0" encoding = "UTF-8"?>
><Name xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>xsi:noNamespaceSchemaLocation="name.xsd">
><firstName>John</firstName>
><middleName>C</middleName>
><lastName>Fleet</lastName>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org