Tuesday, 8 April 2008

Error-See Servlet Spec 2.3, section 9.7.2. Offending class:

When I upload udlandscall.war into test server (Tomcat), which gave following errors:


"2008-04-08 14:52:01 org.apache.catalina.loader.WebappClassLoader validateJarFile

INFO: validateJarFile(/home/plastest/tomcat/webapps/udlandscall/WEB-INF/lib/servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

2008-04-08 14:52:01 org.apache.catalina.startup.HostConfig deployWAR

SEVERE: Error deploying web application archive udlandscall.war"

Reason:
"The classloader that a container uses to load a servlet in a WAR must allow the
developer to load any resources contained in library JARs within the WAR
following normal J2SE semantics using getResource. It must not allow theWAR to
override J2SE or Java servlet API classes. It is further recommended that the loader
not allow servlets in theWAR access to the web container’s implementation classes.
It is recommended also that the application class loader be implemented so
that classes and resources packaged within the WAR are loaded in preference to
classes and resources residing in container-wide library JARs."

The problem is that you are having some of the jar files which are not supposed to be in your war but in container(tomcat) e.g. servlet.jar. It is very common mistake to keep these jars in WEB-INF/lib folder for compilation and ship it with the war file.



No comments:

Can Jackson Deserialize Java Time ZonedDateTime

Yes, but must include JSR310. Thus ZonedDateTime can be deserialized directly from JSON response to POJO field. <dependency> <g...