You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by JS <sm...@dcs.kcl.ac.uk> on 2003/04/09 03:01:40 UTC

the dreaded org.xml.sax.SAXParseException error...arrgghh!!!

This one has been killing my day.
I've checked the archives and other forums for some insight but no luck.
>From what I know and can see below, my web.xml file follows the required
DTD structure. Yet I continue to get the dreaded
org.xml.sax.SAXParseException error...as below.
I dont know what I'm missing. Right now my eyes are so tired, it could be
staring me in the face. Hopefully, some fresh eyes will help.
Many thanks
JS


-----------------------
Output from catalina.out
------------------------
[ERROR] Digester - -Parse Error at line 18 column 12: The content of
element type "servlet" must match
"(icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),init-param*,load-on-startup?,run-as?,security-role-ref*)".
<org.xml.sax.SAXParseException: The content of element type "servlet" must
match
"(icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),init-param*,load-on-startup?,run-as?,security-role-ref*)".>org.xml.sax.SAXParseException: The content of element type "web-app" must
match
"(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".

----------------------
Snippet from jwsdp.log
----------------------
2003-04-09 01:47:27 Exception initializing TldLocationsCache: XML parsing
error on file /WEB-INF/web.xml: (line 18, col 12): The content of element
type "servlet" must match
"(icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),init-param*,load-on-startup?,run-as?,security-role-ref*)".2003-04-09 01:47:27 HostConfig[localhost]: Deploying web application
directory mydcs2003-04-09 01:47:27 StandardHost[localhost]: Installing web application at
context path /mydcs from URL file:C:\WINDOWS\jwsdp-1_0_01\webapps\mydcs2003-04-09 01:47:27 WebappLoader[/mydcs]: Deploying class repositories to
work directory C:\WINDOWS\jwsdp-1_0_01\work\Standard
Engine\localhost\mydcs2003-04-09 01:47:27 WebappLoader[/mydcs]: Deploy class files
/WEB-INF/classes to C:\WINDOWS\jwsdp-1_0_01\webapps\mydcs\WEB-INF\classes2003-04-09 01:47:27 ContextConfig[/mydcs] Parse error in application web.xml
java.lang.reflect.InvocationTargetException
	at
	org.apache.commons.digester.Digester.createSAXException(Digester.java:2033)  ......
   .....
    .....
2003-04-09 01:47:27 ContextConfig[/mydcs]: Occurred at line 41 column 20
2003-04-09 01:47:27 ContextConfig[/mydcs]: Marking this application
unavailable due to previous error(s)2003-04-09 01:47:27 StandardManager[/mydcs]: Seeding random number
generator class java.security.SecureRandom
-----------------
And heres web.xml
------------------



<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app PUBLIC
	"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
	<display-name>XML Web Service for DCS</display-name>

	<servlet>
	   <servlet-name>LoginServlet</servlet-name>
	   <servlet-class>LoginServlet</servlet-class>
	   <load-on-startup>1</load-on-startup>
	</servlet>
<!--
	<servlet>
	    <servlet-name>coreservlets.ConnectionPoolServlet</servlet-name>
*****Here is line 18....its even commented out!!***
	    <servlet-class>coreservlets.ConnectionPoolServlet</servlet-class>
	    <load-on-startup>1</load-on-startup>
	</servlet>
-->
	<servlet>
	    <servlet-name>LoginServletNoPool</servlet-name>
	    <servlet-class>LoginServletNoPool</servlet-class>
	    <load-on-startup>1</load-on-startup>
	</servlet>

	<servlet>
	    <servlet-name>JDOMServlet</servlet-name>
	    <servlet-class>JDOMServlet</servlet-class>
	</servlet>

	<servlet-mapping>
		<servlet-name>JDOMServlet</servlet-name>
		<url-pattern>/servlet</url-pattern>
	</servlet-mapping>

	<servlet-mapping>
		<servlet-name>coreservlets.ConnectionPoolServlet</servlet-name>
		<url-pattern>/servlet</url-pattern>
	</servlet-mapping>
</web-app>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: the dreaded org.xml.sax.SAXParseException error...got the bugger!!!

Posted by Filip Hanik <ma...@filip.net>.
well, in the next servlet spec, the web.xml will relax on the ordering of
elements :)

> -----Original Message-----
> From: JS [mailto:smartt@dcs.kcl.ac.uk]
> Sent: Wednesday, April 09, 2003 2:39 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: the dreaded org.xml.sax.SAXParseException error...got the
> bugger!!!
>
>
> Hiya....
> Thanks for your help G.Wade and everyone. Finally got the bug. Basically
> trawled through all the web.xml files that I felt were the likely suspects
> (i.e. all those I touched).Problem was that some of my tags
> weren't in the correct order as defined
> by the Sun DTD for web.xmlMy fault really as I had been using the
> structure given in a book which
> used a different version of tomcat. D'oh!!
> Anyway, thanks again.
> JS
>
> > I would suggest looking at all of the web.xml files under the
> > CATALINA_HOME directory. (In Windows, you can use "dir /s web.xml".)
> >
> > You'll pretty much want to look at line 18 of all of them to find the
> > one with the problem, I think. I don't know if anyone knows of a way to
> > identify which web.xml file got stomped.
> >
> > Or...You could do a clean install of Tomcat and then add in your
> > webapps and any changes you've made to the main files.
> >
> > Good luck,
> > G. Wade
> >
> > JS wrote:
> >>
> >> Thanks for this, the thought did cross my mind. I think that tomcat
> >> and I are definitely talking about different web.xml files because
> >> when I remove nearly all the tags, it still pops up with an error at
> >> line 18 col 12. I've deleted the old web xml, added a new one, and
> >> still no luck. Any ideas on where I can go from here??
> >>
> >> Many thanks
> >> JS
> >>
> >> > In other XML applications when I've had a validation error on code
> >> > that I could see was obviously right, it turned out that I was
> >> > looking at a different file than the program was.
> >> >
> >> > So, at the risk of sounding obnoxious are you sure you're looking at
> >> > the right file?
> >> >
> >> > The other thing that has bitten me is an invalid character in my
> >> > content.
> >> >
> >> > Just a thought,
> >> > G. Wade
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For
> > additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: the dreaded org.xml.sax.SAXParseException error...got the bugger!!!

Posted by JS <sm...@dcs.kcl.ac.uk>.
Hiya....
Thanks for your help G.Wade and everyone. Finally got the bug. Basically
trawled through all the web.xml files that I felt were the likely suspects
(i.e. all those I touched).Problem was that some of my tags weren't in the correct order as defined
by the Sun DTD for web.xmlMy fault really as I had been using the structure given in a book which
used a different version of tomcat. D'oh!!
Anyway, thanks again.
JS

> I would suggest looking at all of the web.xml files under the
> CATALINA_HOME directory. (In Windows, you can use "dir /s web.xml".)
>
> You'll pretty much want to look at line 18 of all of them to find the
> one with the problem, I think. I don't know if anyone knows of a way to
> identify which web.xml file got stomped.
>
> Or...You could do a clean install of Tomcat and then add in your
> webapps and any changes you've made to the main files.
>
> Good luck,
> G. Wade
>
> JS wrote:
>>
>> Thanks for this, the thought did cross my mind. I think that tomcat
>> and I are definitely talking about different web.xml files because
>> when I remove nearly all the tags, it still pops up with an error at
>> line 18 col 12. I've deleted the old web xml, added a new one, and
>> still no luck. Any ideas on where I can go from here??
>>
>> Many thanks
>> JS
>>
>> > In other XML applications when I've had a validation error on code
>> > that I could see was obviously right, it turned out that I was
>> > looking at a different file than the program was.
>> >
>> > So, at the risk of sounding obnoxious are you sure you're looking at
>> > the right file?
>> >
>> > The other thing that has bitten me is an invalid character in my
>> > content.
>> >
>> > Just a thought,
>> > G. Wade
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For
> additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: the dreaded org.xml.sax.SAXParseException error...arrgghh!!!

Posted by "G. Wade Johnson" <wa...@abbnm.com>.
I would suggest looking at all of the web.xml files under the
CATALINA_HOME directory. (In Windows, you can use "dir /s web.xml".)

You'll pretty much want to look at line 18 of all of them to find the
one with the problem, I think. I don't know if anyone knows of a way to
identify which web.xml file got stomped.

Or...You could do a clean install of Tomcat and then add in your
webapps and any changes you've made to the main files.

Good luck,
G. Wade

JS wrote:
> 
> Thanks for this, the thought did cross my mind. I think that tomcat and I
> are definitely talking about different web.xml files because when I remove
> nearly all the tags, it still pops up with an error at line 18 col 12.
> I've deleted the old web xml, added a new one, and still no luck.
> Any ideas on where I can go from here??
> 
> Many thanks
> JS
> 
> > In other XML applications when I've had a validation error on code that
> > I could see was obviously right, it turned out that I was looking at a
> > different file than the program was.
> >
> > So, at the risk of sounding obnoxious are you sure you're looking at
> > the right file?
> >
> > The other thing that has bitten me is an invalid character in my
> > content.
> >
> > Just a thought,
> > G. Wade

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: the dreaded org.xml.sax.SAXParseException error...arrgghh!!!

Posted by JS <sm...@dcs.kcl.ac.uk>.
Thanks for this, the thought did cross my mind. I think that tomcat and I
are definitely talking about different web.xml files because when I remove
nearly all the tags, it still pops up with an error at line 18 col 12.
I've deleted the old web xml, added a new one, and still no luck.
Any ideas on where I can go from here??

Many thanks
JS

> In other XML applications when I've had a validation error on code that
> I could see was obviously right, it turned out that I was looking at a
> different file than the program was.
>
> So, at the risk of sounding obnoxious are you sure you're looking at
> the right file?
>
> The other thing that has bitten me is an invalid character in my
> content.
>
> Just a thought,
> G. Wade
>
> JS wrote:
>>
>> Hi Bill, I posted the web.xml file on my original message. It further
>> below.
>>
>> Thanks for your time.
>> JS
>>
>> > It should be easy enough.  The error is saying that somewhere around
>> > line 18 you have something other than:
>> >  <servlet>
>> >     <!-- possible servlet-icon -->
>> >     <servlet-name>MyServlet</servlet-name>
>> >     <!-- possible servlet-description -->
>> >     <servlet-class>com.myfirm.mypackage.MyServlet</servlet-class>
>> >     <!-- as many init-params as you need -->
>> >     <!-- possible load-on-startup -->
>> >     <!-- possible run-as (mostly for J2EE-embeddings) -->
>> >     <!-- possible security-role-ref -->
>> >  </servlet>
>> >
>> > If this doesn't help, you could always try and post your "web.xml"
>> > file.
>> >
>> > "JS" <sm...@dcs.kcl.ac.uk> wrote in message
>> > news:57708.137.73.8.3.1049850100.squirrel@webmail.dcs.kcl.ac.uk...
>> >> This one has been killing my day.
>> >> I've checked the archives and other forums for some insight but no
>> >> luck. From what I know and can see below, my web.xml file follows
>> >> the required DTD structure. Yet I continue to get the dreaded
>> >> org.xml.sax.SAXParseException error...as below.
>> >> I dont know what I'm missing. Right now my eyes are so tired, it
>> >> could be staring me in the face. Hopefully, some fresh eyes will
>> >> help. Many thanks
>> >> JS
>> >>
>> >>
>> >> -----------------------
>> >> Output from catalina.out
>> >> ------------------------
>> >> [ERROR] Digester - -Parse Error at line 18 column 12: The content
>> >> of element type "servlet" must match
>> >>
>> > "(icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),ini>>> > t-param*,load-on-startup?,run-as?,security-role-ref*)".
>> >> <org.xml.sax.SAXParseException: The content of element type
>> >> "servlet" must match
>> >>
>> > "(icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),ini>>> > t-param*,load-on-startup?,run-as?,security-role-ref*)".>org.xml.sax.SAXParse>>> > Exception: The content of element type "web-app" must
>> >> match
>> >>
>> > "(icon?,display-name?,description?,distributable?,context-param*,filter*,fil>>> > ter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mappin>>> > g*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,se>>> > curity-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-loca>>> > l-ref*)".
>> >>
>> >> ----------------------
>> >> Snippet from jwsdp.log
>> >> ----------------------
>> >> 2003-04-09 01:47:27 Exception initializing TldLocationsCache: XML
>> >> parsing error on file /WEB-INF/web.xml: (line 18, col 12): The
>> >> content of element type "servlet" must match
>> >>
>> > "(icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),ini>>> > t-param*,load-on-startup?,run-as?,security-role-ref*)".2003-04-09
>> > 01:47:27 HostConfig[localhost]: Deploying web application
>> >> directory mydcs2003-04-09 01:47:27 StandardHost[localhost]:
>> >> Installing web
>> > application at
>> >> context path /mydcs from URL
>> > file:C:\WINDOWS\jwsdp-1_0_01\webapps\mydcs2003-04-09 01:47:27
>> > WebappLoader[/mydcs]: Deploying class repositories to
>> >> work directory C:\WINDOWS\jwsdp-1_0_01\work\Standard
>> >> Engine\localhost\mydcs2003-04-09 01:47:27 WebappLoader[/mydcs]:
>> >> Deploy
>> > class files
>> >> /WEB-INF/classes to
>> > C:\WINDOWS\jwsdp-1_0_01\webapps\mydcs\WEB-INF\classes2003-04-09
>> > 01:47:27 ContextConfig[/mydcs] Parse error in application web.xml
>> >> java.lang.reflect.InvocationTargetException
>> >> at
>> >>
>> > org.apache.commons.digester.Digester.createSAXException(Digester.java:2033)>> > ......
>> >>    .....
>> >>     .....
>> >> 2003-04-09 01:47:27 ContextConfig[/mydcs]: Occurred at line 41
>> >> column 20 2003-04-09 01:47:27 ContextConfig[/mydcs]: Marking this
>> >> application unavailable due to previous error(s)2003-04-09 01:47:27
>> > StandardManager[/mydcs]: Seeding random number
>> >> generator class java.security.SecureRandom
>> >> -----------------
>> >> And heres web.xml
>> >> ------------------
>> >>
>> >>
>> >>
>> >> <?xml version="1.0" encoding="ISO-8859-1"?>
>> >>
>> >> <!DOCTYPE web-app PUBLIC
>> >> "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>> >>     "http://java.sun.com/dtd/web-app_2_3.dtd">
>> >>
>> >> <web-app>
>> >> <display-name>XML Web Service for DCS</display-name>
>> >>
>> >> <servlet>
>> >>    <servlet-name>LoginServlet</servlet-name>
>> >>    <servlet-class>LoginServlet</servlet-class>
>> >>    <load-on-startup>1</load-on-startup>
>> >> </servlet>
>> >> <!--
>> >> <servlet>
>> >>     <servlet-name>coreservlets.ConnectionPoolServlet</servlet-name>
>> >> *****Here is line 18....its even commented out!!***
>> >>     <servlet-class>coreservlets.ConnectionPoolServlet</servlet-class>
>> >>     <load-on-startup>1</load-on-startup>
>> >> </servlet>
>> >> -->
>> >> <servlet>
>> >>     <servlet-name>LoginServletNoPool</servlet-name>
>> >>     <servlet-class>LoginServletNoPool</servlet-class>
>> >>     <load-on-startup>1</load-on-startup>
>> >> </servlet>
>> >>
>> >> <servlet>
>> >>     <servlet-name>JDOMServlet</servlet-name>
>> >>     <servlet-class>JDOMServlet</servlet-class>
>> >> </servlet>
>> >>
>> >> <servlet-mapping>
>> >> <servlet-name>JDOMServlet</servlet-name>
>> >> <url-pattern>/servlet</url-pattern>
>> >> </servlet-mapping>
>> >>
>> >> <servlet-mapping>
>> >> <servlet-name>coreservlets.ConnectionPoolServlet</servlet-name>
>> >> <url-pattern>/servlet</url-pattern>
>> >> </servlet-mapping>
>> >> </web-app>
>> >
>> >
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For
>> additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For
> additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: the dreaded org.xml.sax.SAXParseException error...arrgghh!!!

Posted by "G. Wade Johnson" <wa...@abbnm.com>.
In other XML applications when I've had a validation error on code that
I could see was obviously right, it turned out that I was looking at a
different file than the program was.

So, at the risk of sounding obnoxious are you sure you're looking at
the right file?

The other thing that has bitten me is an invalid character in my
content.

Just a thought,
G. Wade

JS wrote:
> 
> Hi Bill, I posted the web.xml file on my original message. It further below.
> 
> Thanks for your time.
> JS
> 
> > It should be easy enough.  The error is saying that somewhere around
> > line 18 you have something other than:
> >  <servlet>
> >     <!-- possible servlet-icon -->
> >     <servlet-name>MyServlet</servlet-name>
> >     <!-- possible servlet-description -->
> >     <servlet-class>com.myfirm.mypackage.MyServlet</servlet-class> <!--
> >     as many init-params as you need -->
> >     <!-- possible load-on-startup -->
> >     <!-- possible run-as (mostly for J2EE-embeddings) -->
> >     <!-- possible security-role-ref -->
> >  </servlet>
> >
> > If this doesn't help, you could always try and post your "web.xml"
> > file.
> >
> > "JS" <sm...@dcs.kcl.ac.uk> wrote in message
> > news:57708.137.73.8.3.1049850100.squirrel@webmail.dcs.kcl.ac.uk...
> >> This one has been killing my day.
> >> I've checked the archives and other forums for some insight but no
> >> luck. From what I know and can see below, my web.xml file follows the
> >> required DTD structure. Yet I continue to get the dreaded
> >> org.xml.sax.SAXParseException error...as below.
> >> I dont know what I'm missing. Right now my eyes are so tired, it could
> >> be staring me in the face. Hopefully, some fresh eyes will help.
> >> Many thanks
> >> JS
> >>
> >>
> >> -----------------------
> >> Output from catalina.out
> >> ------------------------
> >> [ERROR] Digester - -Parse Error at line 18 column 12: The content of
> >> element type "servlet" must match
> >>
> > "(icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),ini> t-param*,load-on-startup?,run-as?,security-role-ref*)".
> >> <org.xml.sax.SAXParseException: The content of element type "servlet"
> >> must match
> >>
> > "(icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),ini> t-param*,load-on-startup?,run-as?,security-role-ref*)".>org.xml.sax.SAXParse> Exception: The content of element type "web-app" must
> >> match
> >>
> > "(icon?,display-name?,description?,distributable?,context-param*,filter*,fil> ter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mappin> g*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,se> curity-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-loca> l-ref*)".
> >>
> >> ----------------------
> >> Snippet from jwsdp.log
> >> ----------------------
> >> 2003-04-09 01:47:27 Exception initializing TldLocationsCache: XML
> >> parsing error on file /WEB-INF/web.xml: (line 18, col 12): The content
> >> of element type "servlet" must match
> >>
> > "(icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),ini> t-param*,load-on-startup?,run-as?,security-role-ref*)".2003-04-09
> > 01:47:27 HostConfig[localhost]: Deploying web application
> >> directory mydcs2003-04-09 01:47:27 StandardHost[localhost]: Installing
> >> web
> > application at
> >> context path /mydcs from URL
> > file:C:\WINDOWS\jwsdp-1_0_01\webapps\mydcs2003-04-09 01:47:27
> > WebappLoader[/mydcs]: Deploying class repositories to
> >> work directory C:\WINDOWS\jwsdp-1_0_01\work\Standard
> >> Engine\localhost\mydcs2003-04-09 01:47:27 WebappLoader[/mydcs]: Deploy
> > class files
> >> /WEB-INF/classes to
> > C:\WINDOWS\jwsdp-1_0_01\webapps\mydcs\WEB-INF\classes2003-04-09
> > 01:47:27 ContextConfig[/mydcs] Parse error in application web.xml
> >> java.lang.reflect.InvocationTargetException
> >> at
> >>
> > org.apache.commons.digester.Digester.createSAXException(Digester.java:2033)
> > ......
> >>    .....
> >>     .....
> >> 2003-04-09 01:47:27 ContextConfig[/mydcs]: Occurred at line 41 column
> >> 20 2003-04-09 01:47:27 ContextConfig[/mydcs]: Marking this application
> >> unavailable due to previous error(s)2003-04-09 01:47:27
> > StandardManager[/mydcs]: Seeding random number
> >> generator class java.security.SecureRandom
> >> -----------------
> >> And heres web.xml
> >> ------------------
> >>
> >>
> >>
> >> <?xml version="1.0" encoding="ISO-8859-1"?>
> >>
> >> <!DOCTYPE web-app PUBLIC
> >> "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
> >>     "http://java.sun.com/dtd/web-app_2_3.dtd">
> >>
> >> <web-app>
> >> <display-name>XML Web Service for DCS</display-name>
> >>
> >> <servlet>
> >>    <servlet-name>LoginServlet</servlet-name>
> >>    <servlet-class>LoginServlet</servlet-class>
> >>    <load-on-startup>1</load-on-startup>
> >> </servlet>
> >> <!--
> >> <servlet>
> >>     <servlet-name>coreservlets.ConnectionPoolServlet</servlet-name>
> >> *****Here is line 18....its even commented out!!***
> >>     <servlet-class>coreservlets.ConnectionPoolServlet</servlet-class>
> >>     <load-on-startup>1</load-on-startup>
> >> </servlet>
> >> -->
> >> <servlet>
> >>     <servlet-name>LoginServletNoPool</servlet-name>
> >>     <servlet-class>LoginServletNoPool</servlet-class>
> >>     <load-on-startup>1</load-on-startup>
> >> </servlet>
> >>
> >> <servlet>
> >>     <servlet-name>JDOMServlet</servlet-name>
> >>     <servlet-class>JDOMServlet</servlet-class>
> >> </servlet>
> >>
> >> <servlet-mapping>
> >> <servlet-name>JDOMServlet</servlet-name>
> >> <url-pattern>/servlet</url-pattern>
> >> </servlet-mapping>
> >>
> >> <servlet-mapping>
> >> <servlet-name>coreservlets.ConnectionPoolServlet</servlet-name>
> >> <url-pattern>/servlet</url-pattern>
> >> </servlet-mapping>
> >> </web-app>
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For
> > additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: the dreaded org.xml.sax.SAXParseException error...arrgghh!!!

Posted by JS <sm...@dcs.kcl.ac.uk>.
Hi Bill, I posted the web.xml file on my original message. It further below.

Thanks for your time.
JS

> It should be easy enough.  The error is saying that somewhere around
> line 18 you have something other than:
>  <servlet>
>     <!-- possible servlet-icon -->
>     <servlet-name>MyServlet</servlet-name>
>     <!-- possible servlet-description -->
>     <servlet-class>com.myfirm.mypackage.MyServlet</servlet-class> <!--
>     as many init-params as you need -->
>     <!-- possible load-on-startup -->
>     <!-- possible run-as (mostly for J2EE-embeddings) -->
>     <!-- possible security-role-ref -->
>  </servlet>
>
> If this doesn't help, you could always try and post your "web.xml"
> file.
>
> "JS" <sm...@dcs.kcl.ac.uk> wrote in message
> news:57708.137.73.8.3.1049850100.squirrel@webmail.dcs.kcl.ac.uk...
>> This one has been killing my day.
>> I've checked the archives and other forums for some insight but no
>> luck. From what I know and can see below, my web.xml file follows the
>> required DTD structure. Yet I continue to get the dreaded
>> org.xml.sax.SAXParseException error...as below.
>> I dont know what I'm missing. Right now my eyes are so tired, it could
>> be staring me in the face. Hopefully, some fresh eyes will help.
>> Many thanks
>> JS
>>
>>
>> -----------------------
>> Output from catalina.out
>> ------------------------
>> [ERROR] Digester - -Parse Error at line 18 column 12: The content of
>> element type "servlet" must match
>>
> "(icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),ini> t-param*,load-on-startup?,run-as?,security-role-ref*)".
>> <org.xml.sax.SAXParseException: The content of element type "servlet"
>> must match
>>
> "(icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),ini> t-param*,load-on-startup?,run-as?,security-role-ref*)".>org.xml.sax.SAXParse> Exception: The content of element type "web-app" must
>> match
>>
> "(icon?,display-name?,description?,distributable?,context-param*,filter*,fil> ter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mappin> g*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,se> curity-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-loca> l-ref*)".
>>
>> ----------------------
>> Snippet from jwsdp.log
>> ----------------------
>> 2003-04-09 01:47:27 Exception initializing TldLocationsCache: XML
>> parsing error on file /WEB-INF/web.xml: (line 18, col 12): The content
>> of element type "servlet" must match
>>
> "(icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),ini> t-param*,load-on-startup?,run-as?,security-role-ref*)".2003-04-09
> 01:47:27 HostConfig[localhost]: Deploying web application
>> directory mydcs2003-04-09 01:47:27 StandardHost[localhost]: Installing
>> web
> application at
>> context path /mydcs from URL
> file:C:\WINDOWS\jwsdp-1_0_01\webapps\mydcs2003-04-09 01:47:27
> WebappLoader[/mydcs]: Deploying class repositories to
>> work directory C:\WINDOWS\jwsdp-1_0_01\work\Standard
>> Engine\localhost\mydcs2003-04-09 01:47:27 WebappLoader[/mydcs]: Deploy
> class files
>> /WEB-INF/classes to
> C:\WINDOWS\jwsdp-1_0_01\webapps\mydcs\WEB-INF\classes2003-04-09
> 01:47:27 ContextConfig[/mydcs] Parse error in application web.xml
>> java.lang.reflect.InvocationTargetException
>> at
>>
> org.apache.commons.digester.Digester.createSAXException(Digester.java:2033)
> ......
>>    .....
>>     .....
>> 2003-04-09 01:47:27 ContextConfig[/mydcs]: Occurred at line 41 column
>> 20 2003-04-09 01:47:27 ContextConfig[/mydcs]: Marking this application
>> unavailable due to previous error(s)2003-04-09 01:47:27
> StandardManager[/mydcs]: Seeding random number
>> generator class java.security.SecureRandom
>> -----------------
>> And heres web.xml
>> ------------------
>>
>>
>>
>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>
>> <!DOCTYPE web-app PUBLIC
>> "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>>     "http://java.sun.com/dtd/web-app_2_3.dtd">
>>
>> <web-app>
>> <display-name>XML Web Service for DCS</display-name>
>>
>> <servlet>
>>    <servlet-name>LoginServlet</servlet-name>
>>    <servlet-class>LoginServlet</servlet-class>
>>    <load-on-startup>1</load-on-startup>
>> </servlet>
>> <!--
>> <servlet>
>>     <servlet-name>coreservlets.ConnectionPoolServlet</servlet-name>
>> *****Here is line 18....its even commented out!!***
>>     <servlet-class>coreservlets.ConnectionPoolServlet</servlet-class>
>>     <load-on-startup>1</load-on-startup>
>> </servlet>
>> -->
>> <servlet>
>>     <servlet-name>LoginServletNoPool</servlet-name>
>>     <servlet-class>LoginServletNoPool</servlet-class>
>>     <load-on-startup>1</load-on-startup>
>> </servlet>
>>
>> <servlet>
>>     <servlet-name>JDOMServlet</servlet-name>
>>     <servlet-class>JDOMServlet</servlet-class>
>> </servlet>
>>
>> <servlet-mapping>
>> <servlet-name>JDOMServlet</servlet-name>
>> <url-pattern>/servlet</url-pattern>
>> </servlet-mapping>
>>
>> <servlet-mapping>
>> <servlet-name>coreservlets.ConnectionPoolServlet</servlet-name>
>> <url-pattern>/servlet</url-pattern>
>> </servlet-mapping>
>> </web-app>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For
> additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: the dreaded org.xml.sax.SAXParseException error...arrgghh!!!

Posted by Bill Barker <wb...@wilshire.com>.
It should be easy enough.  The error is saying that somewhere around line 18
you have something other than:
  <servlet>
     <!-- possible servlet-icon -->
     <servlet-name>MyServlet</servlet-name>
     <!-- possible servlet-description -->
     <servlet-class>com.myfirm.mypackage.MyServlet</servlet-class>
     <!-- as many init-params as you need -->
     <!-- possible load-on-startup -->
     <!-- possible run-as (mostly for J2EE-embeddings) -->
     <!-- possible security-role-ref -->
  </servlet>

If this doesn't help, you could always try and post your "web.xml" file.

"JS" <sm...@dcs.kcl.ac.uk> wrote in message
news:57708.137.73.8.3.1049850100.squirrel@webmail.dcs.kcl.ac.uk...
> This one has been killing my day.
> I've checked the archives and other forums for some insight but no luck.
> From what I know and can see below, my web.xml file follows the required
> DTD structure. Yet I continue to get the dreaded
> org.xml.sax.SAXParseException error...as below.
> I dont know what I'm missing. Right now my eyes are so tired, it could be
> staring me in the face. Hopefully, some fresh eyes will help.
> Many thanks
> JS
>
>
> -----------------------
> Output from catalina.out
> ------------------------
> [ERROR] Digester - -Parse Error at line 18 column 12: The content of
> element type "servlet" must match
>
"(icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),ini
t-param*,load-on-startup?,run-as?,security-role-ref*)".
> <org.xml.sax.SAXParseException: The content of element type "servlet" must
> match
>
"(icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),ini
t-param*,load-on-startup?,run-as?,security-role-ref*)".>org.xml.sax.SAXParse
Exception: The content of element type "web-app" must
> match
>
"(icon?,display-name?,description?,distributable?,context-param*,filter*,fil
ter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mappin
g*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,se
curity-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-loca
l-ref*)".
>
> ----------------------
> Snippet from jwsdp.log
> ----------------------
> 2003-04-09 01:47:27 Exception initializing TldLocationsCache: XML parsing
> error on file /WEB-INF/web.xml: (line 18, col 12): The content of element
> type "servlet" must match
>
"(icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),ini
t-param*,load-on-startup?,run-as?,security-role-ref*)".2003-04-09 01:47:27
HostConfig[localhost]: Deploying web application
> directory mydcs2003-04-09 01:47:27 StandardHost[localhost]: Installing web
application at
> context path /mydcs from URL
file:C:\WINDOWS\jwsdp-1_0_01\webapps\mydcs2003-04-09 01:47:27
WebappLoader[/mydcs]: Deploying class repositories to
> work directory C:\WINDOWS\jwsdp-1_0_01\work\Standard
> Engine\localhost\mydcs2003-04-09 01:47:27 WebappLoader[/mydcs]: Deploy
class files
> /WEB-INF/classes to
C:\WINDOWS\jwsdp-1_0_01\webapps\mydcs\WEB-INF\classes2003-04-09 01:47:27
ContextConfig[/mydcs] Parse error in application web.xml
> java.lang.reflect.InvocationTargetException
> at
>
org.apache.commons.digester.Digester.createSAXException(Digester.java:2033)
......
>    .....
>     .....
> 2003-04-09 01:47:27 ContextConfig[/mydcs]: Occurred at line 41 column 20
> 2003-04-09 01:47:27 ContextConfig[/mydcs]: Marking this application
> unavailable due to previous error(s)2003-04-09 01:47:27
StandardManager[/mydcs]: Seeding random number
> generator class java.security.SecureRandom
> -----------------
> And heres web.xml
> ------------------
>
>
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <!DOCTYPE web-app PUBLIC
> "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>     "http://java.sun.com/dtd/web-app_2_3.dtd">
>
> <web-app>
> <display-name>XML Web Service for DCS</display-name>
>
> <servlet>
>    <servlet-name>LoginServlet</servlet-name>
>    <servlet-class>LoginServlet</servlet-class>
>    <load-on-startup>1</load-on-startup>
> </servlet>
> <!--
> <servlet>
>     <servlet-name>coreservlets.ConnectionPoolServlet</servlet-name>
> *****Here is line 18....its even commented out!!***
>     <servlet-class>coreservlets.ConnectionPoolServlet</servlet-class>
>     <load-on-startup>1</load-on-startup>
> </servlet>
> -->
> <servlet>
>     <servlet-name>LoginServletNoPool</servlet-name>
>     <servlet-class>LoginServletNoPool</servlet-class>
>     <load-on-startup>1</load-on-startup>
> </servlet>
>
> <servlet>
>     <servlet-name>JDOMServlet</servlet-name>
>     <servlet-class>JDOMServlet</servlet-class>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>JDOMServlet</servlet-name>
> <url-pattern>/servlet</url-pattern>
> </servlet-mapping>
>
> <servlet-mapping>
> <servlet-name>coreservlets.ConnectionPoolServlet</servlet-name>
> <url-pattern>/servlet</url-pattern>
> </servlet-mapping>
> </web-app>




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org