tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Boynes <jer...@boynes.com>
Subject Re: Possibly spurious warning in 8.0.0-RC1: Unknown servlet level "2.3"
Date Tue, 06 Aug 2013 23:01:11 GMT
On Tue, Aug 6, 2013 at 1:06 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> All,
>
> I just launched my primary webapp in an 8.0.0-RC1 and saw this message:
>
> Aug 06, 2013 3:48:13 PM org.apache.tomcat.util.descriptor.web.WebXml
> setVersion
> WARNING: Unknown version string [2.3]. Default version will be used.
>
> My actual uses version "2.5":
>
> <web-app xmlns="http://java.sun.com/xml/ns/javaee"
>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>          version="2.5"
>          metadata-complete="true">
>
> ...however, I have a "dummy" ROOT webapp to catch requests that go to
> unknown webapps and give a nicer error message. This is the web.xml
> declaration:
>
> <!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 xmlns="http://java.sun.com/xml/ns/j2ee" version="2.3">
>   <display-name>Dummy ROOT context to prevent 400 Bad Request
> responses</display-name>
> </web-app>
>
> Obviously, I should probably upgrade my dummy ROOT webapp, but servlet
> version 2.3 should still be supported, no?
>

The 2.3 DTD does not have a "version" attribute. This is being reported as
that is not a valid version to specify and it should be falling back to the
default. Because you have a DOCTYPE the setPublicId call should be setting
that to 2.3 rather than 3.1

IOW, you're getting a warning because the XML is incorrect but the app
should be running with an effective version of 2.3 based on the DOCTYPE.
Removing the unneeded version attribute would make that warning go away.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message