You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2013/08/06 22:06:31 UTC

Possibly spurious warning in 8.0.0-RC1: Unknown servlet level "2.3"

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?

-chris


Re: Possibly spurious warning in 8.0.0-RC1: Unknown servlet level "2.3"

Posted by Jeremy Boynes <je...@boynes.com>.
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.