Skip to main content

Metro 2.1.1 and Servlet version 3.0 with Tomcat - Many Startup Errors

1 reply [Last post]
kikekewl
Offline
Joined: 2011-11-14
Points: 0

Hi all,

When using the following element in the web descriptor:

<web-app version="3.0"
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_3_0.xsd">

I get many sartupr errors with Metro 2.1.1 and Tomacat 7.0.22.

This is the last error that appears in the console:

14/11/2011 12:19:45 PM org.apache.catalina.startup.ContextConfig checkHandlesTypes
ADVERTENCIA: No puedo cargar la clase [org.apache.xml.resolver.tools.ResolvingXMLReader] para revisar contra la anotación @HandlesTypes de uno o más ServletContentInitializers.
java.lang.ClassNotFoundException: org.apache.xml.resolver.tools.ResolvingXMLReader
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2006)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1969)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1858)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1826)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1812)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1306)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:896)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:322)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3854)
at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:424)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1214)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1400)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1410)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1410)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1389)
at java.lang.Thread.run(Unknown Source)

I found that if I switch the version for the web element in the web descritor it works just fine:

<web-app version="2.5"
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">

Why does this happen? Does it mean we can't use the servlet 3.0 elements in our web descritor when using Metro?

I'm using:

- Tomcat 7.0.22
- Metro 2.1.1 (installed via ant)
- JRE 1.6.0_29

Thank you.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kikekewl
Offline
Joined: 2011-11-14
Points: 0

Nevermind.

I solved it, add this attribute to the web element:

metadata-complete="true"

And now it should work with the servlet 3.0 spec.

Hope it helps!

Thank you.