tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: should <error-page/> work on Tomcat 4.1.30?
Date Mon, 26 Jul 2004 13:44:23 GMT
Hi,
Yes, error-page should work.  Your <error-page> element itself is fine,
but as the error message says, it's in the wrong place of web.xml.  Post
your complete web.xml and we can help you sort it out, or simply
reorganize your elements in web.xml according to the order specified in
the DTD and repeated in the error message.

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: Gary Zhu [mailto:gzhu@timeicr.com]
>Sent: Monday, July 26, 2004 9:36 AM
>To: Tomcat Users List
>Subject: should <error-page/> work on Tomcat 4.1.30?
>
>
>Hi,
>
>I am trying to setup <error-page> for my servlet applications, here is
what
>I did (In snippets):
><?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>
>	<!-- ERROR MAPPINGS -->
>	<error-page>
>		<error-code>404</error-code>
>		<location>/error.html</location>
>	</error-page>
>   .....
></web-app>
>
>Below is the error message I got from Tomcat AppServer:
>SEVERE: Parse Error at line 164 column 11: 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*,resou
rce-
>ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-
>ref*,ejb-local-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*,sess
ion-
>config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-e
nv-
>ref*,resource-ref*,security-constraint*,login-config?,security-role*,en
v-
>entry*,ejb-ref*,ejb-local-ref*)".
>	at
>org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Erro
rHan
>dlerWrapper.java:232)
>	at
>org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.ja
va:1
>73)
>	at
>org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.ja
va:3
>62)
>	at
>org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.ja
va:2
>96)
>	at
>org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValid
ator
>.java:1953)
>	at
>org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.j
ava:
>878)
>	at
>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.handleEndElement(
XMLD
>ocumentFragmentScannerImpl.java:1144)
>	at
>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XM
LDoc
>umentFragmentScannerImpl.java:987)
>	at
>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDi
spat
>cher.dispatch(XMLDocumentFragmentScannerImpl.java:1445)
>	at
>org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLD
ocum
>entFragmentScannerImpl.java:333)
>	at
>org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:
524)
>	at
>org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:
580)
>	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
>	at
>org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.jav
a:11
>69)
>	at
org.apache.commons.digester.Digester.parse(Digester.java:1495)
>	at
>org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConf
ig.j
>ava:282)
>	at
>org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:639)
>	at
>org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.
java
>:243)
>	at
>org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleS
uppo
>rt.java:166)
>	at
>org.apache.catalina.core.StandardContext.start(StandardContext.java:349
3)
>	at
>org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.j
ava:
>821)
>	at
>org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
>	at
>org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
>	at
>org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeplo
yer.
>java:257)
>	at
>org.apache.catalina.core.StandardHost.install(StandardHost.java:772)
>	at
>org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.jav
a:56
>9)
>	at
>org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:411)
>	at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:879)
>	at
>org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:3
68)
>	at
>org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleS
uppo
>rt.java:166)
>	at
>org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
>	at
org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
>	at
>org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
>	at
>org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
>	at
>org.apache.catalina.core.StandardService.start(StandardService.java:497
)
>	at
>org.apache.catalina.core.StandardServer.start(StandardServer.java:2189)
>	at
>org.apache.catalina.startup.CatalinaService.start(CatalinaService.java:
271)
>	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>	at
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja
va:3
>9)
>	at
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso
rImp
>l.java:25)
>	at java.lang.reflect.Method.invoke(Method.java:324)
>	at
>org.apache.catalina.startup.BootstrapService.start(BootstrapService.jav
a:24
>5)
>	at
>org.apache.catalina.startup.BootstrapService.main(BootstrapService.java
:307
>)
>
>Any idea? Thanks
>
>Gary
>
>
>---------------------------------------------------------------------
>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


Mime
View raw message