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 "Sivasubramaniam, Latha" <la...@aspect.com> on 2001/10/04 02:21:52 UTC
External parameter entity reference causing null pointer exceptio
n
I am trying to use external parameter entity reference in my XML and
that causes null pointer exception in the DOM parser. I actually don't want
the parser to expand the entity references but according to xerces 1.4.3 api
document says that i can not turn off this feature. Is it that xerces does
not support this feature, does any one know that the next version supports
it or not.
My xml and the external entity file as follows. In the xml if i remove the
lines,
*****************************lines removed *********************
<!ENTITY % userStrings SYSTEM 'D:\temp\aspectContributor.ent'>
%userStrings;
**********************************lines removed *********************
and replace &asptitle; with some regualr text, the parser succeeds.
************************************** XML file
start*************************************
<?xml version="1.0"?>
<!DOCTYPE waConfiguration SYSTEM 'D:\temp\wa.dtd' [
<!ENTITY % userStrings SYSTEM 'D:\temp\aspectContributor.ent'>
%userStrings;
<!ENTITY waLocale 'en'>
<!ENTITY waBaseUrl '/'>
]>
<waConfiguration waVersion="1.2">
<waHeader>
<waApp>
<waAppName>XML Contributor Config
Application</waAppName>
<waAppVersion>1.0</waAppVersion>
</waApp>
</waHeader>
<waBody waShowLastRefreshTime="true">
<waHTML_Prologue dir="ltr">
<H2 dir="ltr">&asptitle;</H2>
<HR/>
</waHTML_Prologue>
<waCategories>
<waCategory waUserLabel="colltypedetLabel"
waId="Collector_Type">
<waString waUserLabel="colltypeLabel"
waId="Collector" waUserMsg="colltypeMsg" waReadOnly="false"
waRequired="true" waMaxLength="40">siri</waString>
<waTextArea waUserLabel="colldescLabel"
waId="Collector_Desc" waUserMsg="colldescMsg" waReadOnly="false"
waRequired="false" waNumRows="2">Collector for AAR Database </waTextArea>
</waCategory>
</waCategories>
</waBody>
</waConfiguration>
****************** XML file end **********************
********************** aspectcontributor.ent file
start*********************
<!ENTITY asptitle 'Aspect XML Real-Time Contributor'>
**********************aspectcontributor.ent file end
*****Stack trace of the exception********
java.lang.NullPointerException
java.lang.Throwable()
java.lang.Exception()
org.xml.sax.SAXException(java.lang.Exception)
void
org.apache.xerces.framework.XMLParser.parse(org.xml.sax.InputSource)
void
com.aspect.xmlcontributor.CContributor.configLoad(java.lang.String)
void com.aspect.xmlcontributor.CContributor.init()
void com.aspect.xmlcontributor.CContributor.main(java.lang.String
[])
Does any one have any idea about this.
Regards
Latha
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
Re: External parameter entity reference causing null pointer exception
Posted by Andy Clark <an...@apache.org>.
"Sivasubramaniam, Latha" wrote:
> I am trying to use external parameter entity reference in my XML and
> that causes null pointer exception in the DOM parser. I actually don't want
Regardless of the error, the parser should never throw a
NullPointerException. Unfortunately, you haven't included
enough information to try to reproduce the error. We need
the DTD at least if we're to try to recreate the error.
> <!DOCTYPE waConfiguration SYSTEM 'D:\temp\wa.dtd' [
> <!ENTITY % userStrings SYSTEM 'D:\temp\aspectContributor.ent'>
Your system identifiers are not URIs. Check the FAQ for
instructions on how you can convert them to URI syntax.
--
Andy Clark * IBM, TRL - Japan * andyc@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