Craig,

What was wrong? :) I deliberately didn't say - wanted to see if anyone could
spot it. The answer: N! classname v className - just an N! That's why I
expected a parse error - classname isn't a valid attribute of an element,
but className is. Talk about fussy :)

The Xerces parser issue is still getting me. TomCat works fine with v2 but
my servlet breaks. The servlet works fine in v1. If I knew why, it would
help with changing the xml documents/DTD/entity files that are causing the
problem when using Xerces 2 The complexities of XML just drive me nuts -
external/internal, general entities, parameter entities... I strongly
suspect that the xml is less than valid and well-formed, but I've yet to
find anything on xml that answers my questions. The DTD extends (or is meant
to) the XHTML Transitional DTD. There are numerous files full of what I
think would be termed "general" entities. The thing that I'm not sure on is
if entities can use external entities. I'm also less than sure on the
declarations - PUBLIC and SYSTEM and all that. I've invested in the world's
thickest book on XML but it's only valuable as a door stop :)

The whole application was written ages ago and doesn't exactly conform to
commercial standards but it was developed by a (nother) University on a
shoestring budget. My University agreed to adopt the system and work with
it. I'm looking at all aspects of the system, apart from the code, which is
way beyond me :) I stuck my neck out and pushed to use the latest software -
e.g. TomCat rather than JServ - even though we didn't know if it would work
with anything other than JServ. It did! Just the xml now! Not even sure if
it was wise to use xml...

John

-----Original Message-----
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: 19 March 2002 20:48
To: Tomcat Users List
Subject: Re: XML curiosities




On Tue, 19 Mar 2002, John Wadkin wrote:

> Date: Tue, 19 Mar 2002 17:22:47 -0000
> From: John Wadkin <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: "Tomcat Users List (E-mail)" <[EMAIL PROTECTED]>
> Subject: XML curiosities
>
> All,
>
> A few XML issues. Firstly, I wrongly put this in server.xml:
>
> <Valve classname="org.apache.catalina.valves.RemoteAddrValve"
>  allow="<ip address>, <ip address>" />
>
> Instead of seeing a SAX parse exception or similar, this appeared in
> catalina.out:
>

I agree that the error message below is less than helpful, but why did you
expect an XML parsing error?  It looks like you have valid XML syntax.
What was wrong that you finally found and fixed?

Craig


> ERROR reading /usr/local/tomcat/conf/server.xml
> At Line 29 /Server/Service/Engine/Host/Context/Valve/
> classname=org.apache.catalina.valves.RemoteAddrValve allow=161.112.*,
> 194.164.*
>
> Catalina.start: java.lang.NullPointerException
> java.lang.NullPointerException
>       at java.lang.Class.forName0(Native Method)
>       at java.lang.Class.forName0(Compiled Code)
>       at java.lang.Class.forName(Compiled Code)
>       at org.apache.catalina.util.xml.ObjectCreate.start(Compiled Code)
>       at org.apache.catalina.util.xml.XmlMapper.matchStart(Compiled Code)
>       at
> org.apache.catalina.util.xml.XmlMapper.startElement(XmlMapper.java:91)
>       at org.xml.sax.helpers.XMLReaderAdapter.startElement(Compiled Code)
>       at org.apache.xerces.parsers.SAXParser.startElement(Compiled Code)
>       at
> org.apache.xerces.validators.common.XMLValidator.callStartElement(Compiled
> Code)
>       at
> org.apache.xerces.framework.XMLDocumentScanner.scanElement(Compiled Code)
>       at
>
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(Co
> mpiled Code)
>       at org.apache.xerces.framework.XMLDocumentScanner.parseSome(Compiled
> Code)
>       at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1081)
>       at
> org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
>       at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
>       at javax.xml.parsers.SAXParser.parse(SAXParser.java:290)
>       at
> org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:228)
>       at org.apache.catalina.startup.Catalina.start(Catalina.java:725)
>       at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
>       at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
>       at java.lang.reflect.Method.invoke(Native Method)
>       at java.lang.reflect.Method.invoke(Compiled Code)
>       at org.apache.catalina.startup.Bootstrap.main(Compiled Code)
>
> Is this behaviour correct? It's very misleading - took me a while to work
> out what was wrong!
>
> Secondly, I changed the parser in common/lib to Xerces 2 - the two jar
> files. I expected TomCat to break, but it worked fine. However, the new
> parser reported that an XML document wasn't well-formed. I didn't think
> upgrading a parser would change the "status" of an XML document from "OK"
to
> "not OK"! What gives? Is the latest version of Xerces more strict?
>
> Solaris 8
> Tomcat 4.0.1
> Apache 1.3
> mod_webapp 1
>
> Thanks,
>
> John
>
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to