Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jersey-dev] Jersey2.29 with Embedded Tomcat

Hi,

I was trying to implement a Web Application with Jersey2.29 and deploy it on an Embedded tomcat server.

My use case is to scan multiple packages and hence I used jersey.config.server.provider.packages in my web.xml.

But when I start this Web App I get an exception because of this:

private void addResourceFinder(final URI u) {
final UriSchemeResourceFinderFactory finderFactory = finderFactories.get(u.getScheme().toLowerCase());
if (finderFactory != null) {
compositeResourceFinder.push(finderFactory.create(u, recursive));
} else {
throw new ResourceFinderException("The URI scheme " + u.getScheme()
+ " of the URI " + u
+ " is not supported. Package scanning deployment is not"
+ " supported for such URIs."
+ "\nTry using a different deployment mechanism such as"
+ " explicitly declaring root resource and provider classes"
+ " using an extension of javax.ws.rs.core.Application");
}
}

Now the reason for this I have disabled WAR unpack in tomcat and hence it builds it URI as war:jar:file:/// which is not a valid URIScheme for PackageScanner.

Strangely, I did not face this problem with Jersey1.x. I debugged it and saw that PackageNameScanner is never used for Jersey1.x and WebAppResourceScanner is used instead. 

Is there anyway to configure the same here? Or any other way I maybe unaware off?

Thanks in advance,
Chirag

Back to the top