You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Daryn Nakhuda <da...@marinated.org> on 2002/03/28 11:07:40 UTC

SAXParseException on catalina.sh run

I'm getting the following error when I run 'catalina.sh run'. It'll happen 
whether I say /path/to/catalina.sh or ./ or just catalina.sh. another user 
with nearly identical server.xml and web.xml doesn't get the error (the 
only differences between our files are port numbers and user names)

Any ideas?  I'm pretty sure the errors are referring to web.xml, and I can 
make it have other errors, but can't get rid of this one, even though 
someone else w/ the same file won't have a problem..

something in my env??!
 

--error--
Starting service Tomcat-Standalone
Apache Tomcat/4.0.3
PARSE error at line 1 column 1
org.xml.sax.SAXParseException: The markup in the document preceding the 
root element must be well-formed.
PARSE error at line 1 column 1
org.xml.sax.SAXParseException: The markup in the document preceding the 
root element must be well-formed.
PARSE error at line 1 column 1
org.xml.sax.SAXParseException: The markup in the document preceding the 
root element must be well-formed.


Server.xml (first few lines)
--------
<!-- Example Server Configuration File -->
<!-- Note that component elements are nested corresponding to their
     parent-child relationships with each other -->

web.xml (first few lines)
--------

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">

<web-app>
  <servlet>






--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: SAXParseException on catalina.sh run

Posted by Daryn Nakhuda <da...@marinated.org>.
The odd thing is that another tomcat server running on the same box with a 
virtually identical (except port numbers and user names) web.xml file 
doesn't complain at all. That's why I was wondering if it was something in 
my environment screwing it up?

my first six lines (exactly):
---------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
        "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">

<web-app>
----------------------

I've tried it both with and without the <?xml line since the other guy's 
works without it.. any other ideas? can I turn up the debugging?



On Thu, 28 Mar 2002, Jeff Larsen wrote:

> The XML parser in Tomcat 4.0.3 requires STRICT adherence
> to XML standards.  I struggled for a while myself before
> I discovered that XML sub-elements must appear in the SAME ORDER
> as they are listed in the DTD. That was news to me, because I
> had never seen a parser that required it.
> 
> So...  make sure your XML is absolutely correct.  Your parse error
> is coming at line 1 column 1 so make sure your web.xml starts with
> <?xml version="1.0" encoding="ISO-8859-1"?> and then make sure
> your <!DOCTYPE> tag is is exactly right. One wrong letter will
> screw it up. Note that server.xml does not need the opening <?xml> 
> or <!DOCTYPE> tags, but web.xml does.
> 
> 
> ----- Original Message ----- 
> From: "Daryn Nakhuda" <da...@marinated.org>
> To: <to...@jakarta.apache.org>
> Sent: Thursday, March 28, 2002 4:07 AM
> Subject: SAXParseException on catalina.sh run
> 
> 
> > 
> > I'm getting the following error when I run 'catalina.sh run'. It'll happen 
> > whether I say /path/to/catalina.sh or ./ or just catalina.sh. another user 
> > with nearly identical server.xml and web.xml doesn't get the error (the 
> > only differences between our files are port numbers and user names)
> > 
> > Any ideas?  I'm pretty sure the errors are referring to web.xml, and I can 
> > make it have other errors, but can't get rid of this one, even though 
> > someone else w/ the same file won't have a problem..
> > 
> > something in my env??!
> >  
> > 
> > --error--
> > Starting service Tomcat-Standalone
> > Apache Tomcat/4.0.3
> > PARSE error at line 1 column 1
> > org.xml.sax.SAXParseException: The markup in the document preceding the 
> > root element must be well-formed.
> > PARSE error at line 1 column 1
> > org.xml.sax.SAXParseException: The markup in the document preceding the 
> > root element must be well-formed.
> > PARSE error at line 1 column 1
> > org.xml.sax.SAXParseException: The markup in the document preceding the 
> > root element must be well-formed.
> > 
> > 
> > Server.xml (first few lines)
> > --------
> > <!-- Example Server Configuration File -->
> > <!-- Note that component elements are nested corresponding to their
> >      parent-child relationships with each other -->
> > 
> > web.xml (first few lines)
> > --------
> > 
> > <!DOCTYPE web-app
> >     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
> >     "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
> > 
> > <web-app>
> >   <servlet>
> > 
> > 
> > 
> > 
> > 
> > 
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
> 

-- 



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: SAXParseException on catalina.sh run

Posted by Jeff Larsen <la...@qec.com>.
The XML parser in Tomcat 4.0.3 requires STRICT adherence
to XML standards.  I struggled for a while myself before
I discovered that XML sub-elements must appear in the SAME ORDER
as they are listed in the DTD. That was news to me, because I
had never seen a parser that required it.

So...  make sure your XML is absolutely correct.  Your parse error
is coming at line 1 column 1 so make sure your web.xml starts with
<?xml version="1.0" encoding="ISO-8859-1"?> and then make sure
your <!DOCTYPE> tag is is exactly right. One wrong letter will
screw it up. Note that server.xml does not need the opening <?xml> 
or <!DOCTYPE> tags, but web.xml does.


----- Original Message ----- 
From: "Daryn Nakhuda" <da...@marinated.org>
To: <to...@jakarta.apache.org>
Sent: Thursday, March 28, 2002 4:07 AM
Subject: SAXParseException on catalina.sh run


> 
> I'm getting the following error when I run 'catalina.sh run'. It'll happen 
> whether I say /path/to/catalina.sh or ./ or just catalina.sh. another user 
> with nearly identical server.xml and web.xml doesn't get the error (the 
> only differences between our files are port numbers and user names)
> 
> Any ideas?  I'm pretty sure the errors are referring to web.xml, and I can 
> make it have other errors, but can't get rid of this one, even though 
> someone else w/ the same file won't have a problem..
> 
> something in my env??!
>  
> 
> --error--
> Starting service Tomcat-Standalone
> Apache Tomcat/4.0.3
> PARSE error at line 1 column 1
> org.xml.sax.SAXParseException: The markup in the document preceding the 
> root element must be well-formed.
> PARSE error at line 1 column 1
> org.xml.sax.SAXParseException: The markup in the document preceding the 
> root element must be well-formed.
> PARSE error at line 1 column 1
> org.xml.sax.SAXParseException: The markup in the document preceding the 
> root element must be well-formed.
> 
> 
> Server.xml (first few lines)
> --------
> <!-- Example Server Configuration File -->
> <!-- Note that component elements are nested corresponding to their
>      parent-child relationships with each other -->
> 
> web.xml (first few lines)
> --------
> 
> <!DOCTYPE web-app
>     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
>     "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
> 
> <web-app>
>   <servlet>
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>