[ 
https://issues.apache.org/jira/browse/CXF-6743?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15095012#comment-15095012
 ] 

Benson Margulies edited comment on CXF-6743 at 1/12/16 9:41 PM:
----------------------------------------------------------------

My workaround broke and had to be laboriously repaired, so I became motivated 
to try to make a real fix.

The problem here is that the JAX-RS API jar is not a pure specification. It has 
executable code in it. The version that CXF depends on contains an SPI that 
doesn't work in OSGi; it ends up getting ClassNotFound errors on Glassfish. 
That's why the CXF Karaf feature replaces it with the ServiceMix jar. When I 
just tried to exclude the spec jar altogether in favor of the SM jar, I got 
strange failures that I could not figure out. So I've ended up forcing the 
dependency at compile time back to the 2.0 spec jar, and then using the SM jar 
at  runtime. If we do what this JIRA says, the existing 2.0.1 dependency in the 
main CXF poms will work right.



was (Author: bmargulies):
My workaround broke and had to be laboriously repaired, so I became motivated 
to try to make a real fix.

The problem here is that the JAX-RS API jar is not a p

> Inconsistent versions of jax-rs specs can lead to OSGi pain
> -----------------------------------------------------------
>
>                 Key: CXF-6743
>                 URL: https://issues.apache.org/jira/browse/CXF-6743
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 3.1.4
>            Reporter: Benson Margulies
>
> CXF's dependency tree calls for:
> {code}
>  <dependency>
>                 <groupId>javax.ws.rs</groupId>
>                 <artifactId>javax.ws.rs-api</artifactId>      
>                 <version>2.0.1</version>      
>              </dependency>
> {code}
> However, the Karaf features asks for a servicemix bundle that only provides 
> version 2.0 of the spec, and indeed, there's no SM bundle for 2.0.1. So, an 
> OSGi bundle built with CXF will be prone to try to import 2.0.1 of the 
> package in this jar, and then fail to be able to wire it.
> If CXF really needs 2.0.1, then we need an SM bundle for 2.0.1 (and the CXF 
> feature should reference it).
> I'll link the SM jira.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to