users@jersey.java.net

[Jersey] Re: Running from eclipse work but not from jar after ant build

From: Matthias Treydte <waldheinz_at_gmail.com>
Date: Wed, 7 Mar 2012 14:30:30 +0100

Hello,

> If I run a project from eclipse, the jersey api work perfect. However if I
> build a jar with my ant build script I always get this error

I reported almost exactly the same problem here yesterday (except I'm
using Maven instead of Ant and Netbeans instead of Eclipse). The
problem seems to be that you're packing your dependencies into a
single "fat" .jar for easier deployment. In this step, the services
entries from the jersey .jars are lost. For Maven I was able to work
around this by configuring the "ServicesResourceTransformer" to be
used by the "shade" plugin. This way, the META-INF/services entries
are preserved and everything works.

I don't know how to achieve this using Ant, but I think it should be possible.

HTH,
-Matthias

-- 
For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled. (R.P. Feynman)