users@jersey.java.net

Re: AbstractMethodError on requesting resource

From: Chris Winters <chris.winters_at_gmail.com>
Date: Tue, 10 Feb 2009 17:49:15 -0500

On Tue, Feb 10, 2009 at 4:36 PM, Chris Winters <chris.winters_at_gmail.com> wrote:
> ...
> 4) This compiles and starts up fine, but on doing a GET I get the exception:
>
> $ GET http://localhost:8080/VoiceConsole/r/device/248421104
>
> java.lang.AbstractMethodError:
> javax.ws.rs.core.UriBuilder.replacePath(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder;
> at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:302)
> at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:239)
> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
> at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1124)
> ...

When in the debugger I noticed the likely issue -- the UriBuilder is
from the Apache CXF, not Jersey. Gah! And it looks like the 0.8 is the
version JSR-311 that the latest CXF uses (2.1.4, coincidentally
released today).

I assumed the CXF version is getting loaded first because it appears
first in the classpath and therefore the ServiceLoader listing (or
something similar), so I renamed 'cxf-2.1.4.jar' to 'z-cxf-2.1.4.jar'.
It actually worked!

It looks like I can fart around with providing the correct
javax.ws.rs.ext.RuntimeDelegate implementation with a properties file
somewhere or other ($java.home/lib -- really? ugh), so I'll try that.
But I wanted to post this so nobody wasted time on my earlier message.

Thanks,

Chris