You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Lars Preben S. Arnesen" <l....@usit.uio.no> on 2002/12/20 10:59:09 UTC

Problems deploying servlet (expect web.xml is the problem)

I have developed a servlet that ran fine on Resin. It also seems to
work when deploying as a war-file. I'm trying to convert to Eclipse
and Tomcat, but I don't want to make war files during development.
Instead of using a war file I have the following entry in the
server.xml file:

<Context path="" docBase="/home/larsar/dev/src/feide-dev/w3ls/moria/src/webapp"
reloadable="true" 
workDir="/home/larsar/dev/src/feide-dev/w3ls/moria/src/webapp/work/org/apache/jsp" />

The web.xml file is located in path/WEB-INF and so is the classes
directory with the compiled class files.

When I start Tomcat I get an exception (included below). I seems like
the problem is in the web.xml, but this works just fine when the
xml-file is included in a war-file. I removed almost all entries and
inserted one by one and when I added a filter, the error occured.

Any tips is appreciated.


    <filter>
	<filter-name>
	    AuthenticationFilter</filter-name>
	<filter-class>
	    no.feide.moria.user.AuthenticationFilter
	</filter-class>
    </filter>


Starting service Tomcat-Standalone
Apache Tomcat/4.1.12
6044 [main] ERROR digester.Digester  - Parse Error at line 105 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*,resource-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*,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*)".
	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)
	at org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:173)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:362)
....

-- 
Lars Preben S. Arnesen

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Problems deploying servlet (expect web.xml is the problem)

Posted by Kief Morris <ki...@kief.com>.
Lars Preben S. Arnesen typed the following on 10:59 20/12/2002 +0100
>When I start Tomcat I get an exception (included below). I seems like
>the problem is in the web.xml, but this works just fine when the
>xml-file is included in a war-file. I removed almost all entries and
>inserted one by one and when I added a filter, the error occured.

Tomcat is much pickier than Resin about what order the elements
go in, so make sure your filter isn't out of order according to this:

>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*)".

I'm not sure why it would work differently in a WAR file, but it's worth
checking.

Kief


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>