users@jersey.java.net

ServletContainer jar scanning exception

From: Richard Wallace <rwallace_at_thewallacepack.net>
Date: Thu, 22 Nov 2007 13:05:26 -0800

Hello,

I'm playing with Jersey because I really like the way the JSR-311 APIs
are shaping up and am trying to decide what to use to create a REST API
to an existing webapp.

I'm trying to get a simple spike up and running using maven and the
maven-jetty-plugin. The first problem I've run into is that 0.5-ea is
not deployed to any maven 2 repository. That's no biggie, I've just
used the maven-install-plugin to install it locally. It would be nice
to get into a public repo though.

Once I got that and the dependencies right, I tried running and am
getting an exception on startup.

Caused by: java.util.zip.ZipException: error in opening zip file
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:114)
        at java.util.jar.JarFile.<init>(JarFile.java:133)
        at java.util.jar.JarFile.<init>(JarFile.java:97)
        at
com.sun.ws.rest.impl.container.config.ResourceClassScanner.indexJar(ResourceClassScanner.java:133)
        at
com.sun.ws.rest.impl.container.config.ResourceClassScanner.index(ResourceClassScanner.java:108)
        at
com.sun.ws.rest.impl.container.config.ResourceClassScanner.scan(ResourceClassScanner.java:78)
 
This seems to be caused because I'm not setting the
com.sun.ws.rest.config.property.ResourcePaths servlet init parameter so
the defaults of /WEB-INF/lib and /WEB-INF/classes are used. The
exception is thrown because the indexJar(File) method is trying to treat
these directories as jars.

So, am I supposed to manually be specifying which jar to scan?

Thanks,
Rich