You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by MaT972 <ma...@gmail.com> on 2015/03/03 18:56:54 UTC

Jersey loaded on startup even if declared in tomcat.util.scan.DefaultJarScanner.jarsToSkip on tomcat7.0.52+

Hi,

One of the applications we are managing is using Jersey for its rest
interface.
This application initializes the rest service with tapestry, so we don't
want it to be initialized at startup by tomcat, and set the following
property in catalina.properties:
tomcat.util.scan.DefaultJarScanner.jarsToSkip=(... jar list provided by
stock tomcat ...)*jersey*.jar

It does as expected in tomcat 7.0.50 but it fails starting at version
7.0.52 (I could not test with 7.0.51 as its not available anymore), and it
still fails at version 7.0.59.

If I add "org.apache.tomcat.util.level = FINEST" in logging.properties, I
can see that the jars are skipped as expected, but jersey is eventually
initialized:

-------------------------
...
FINER: Not scanning JAR
[file:/usr/local/apache-tomcat-7.0.59/webapps/ROOT/WEB-INF/lib/jersey-client-1.12.jar]
from classpath
Mar 03, 2015 6:46:15 PM org.apache.tomcat.util.scan.StandardJarScanner scan
FINER: Not scanning JAR
[file:/usr/local/apache-tomcat-7.0.59/webapps/ROOT/WEB-INF/lib/jersey-core-1.12.jar]
from classpath
....
FINE: preRegister
StandardEngine[Catalina].StandardHost[localhost].StandardContext[].StandardWrapper[com.xxxx.yyyy.yyyy.zzzz.RestModule$RestApplication]
Catalina:j2eeType=Servlet,name=com.xxxx.yyyy.zzzz.RestModule$RestApplication,WebModule=//localhost/,J2EEApplication=none,J2EEServer=none
Mar 03, 2015 6:46:16 PM
com.sun.jersey.server.impl.container.servlet.JerseyServletContainerInitializer
addServletWithApplication
INFO: Registering the Jersey servlet application, named
com.xxxx.yyyy.zzzz.RestModule$RestApplication, at the servlet mapping,
/rest/*, with the Application class of the same name
Mar 03, 2015 6:46:16 PM org.apache.tomcat.util.modeler.Registry
registerComponent
...
-------------------------

Here is the list of the jersey related jars we are loading (which are
located in WEB-INF/lib):
jersey-multipart-1.12.jar
jersey-servlet-1.12.jar
tapestry-jersey-1.0.3.jar
jersey-core-1.12.jar
jersey-client-1.12.jar
jersey-server-1.12.jar
odata4j-jersey-0.7.0.jar
jersey-json-1.12.jar


I have tried many things, but nothing helped.

Any clue of what is going on ?
Any lead will be highly appreciated!

Best regards,

Matt P.