You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Martin Lichtin <li...@yahoo.com.INVALID> on 2015/04/06 21:17:51 UTC

Issue with 'javax.annotation' when installing 'camel' followed by 'cxf' feature

In a Karaf 3.0.3 container one cannot install feature 'camel' followed 
by installing 'cxf'.

karaf@root()> feature:repo-add 
mvn:org.apache.camel.karaf/apache-camel/2.15.1/xml/features
Adding feature url 
mvn:org.apache.camel.karaf/apache-camel/2.15.1/xml/features

karaf@root()> feature:install camel
karaf@root()> feature:install cxf
Refreshing bundles org.apache.servicemix.bundles.spring-context (79), 
org.apache.servicemix.bundles.spring-beans (77), 
org.apache.servicemix.bundles.spring-context-support (80), 
org.apache.servicemix.bundles.spring-core (75)
Error executing command: Can't install feature cxf/0.0.0:
Could not start bundle 
mvn:org.apache.cxf/cxf-rt-rs-extension-providers/3.0.4 in feature(s) 
cxf-jaxrs-3.0.4: Uses constraint violation. Unable to resolve bundle 
revision org.apache.cxf.cxf-rt-frontend-jaxrs [138.0] because it is 
exposed to package 'javax.annotation' from bundle revisions 
javax.annotation-api [93.0] and org.apache.felix.framework [0] via two 
dependency chains.

Chain 1:
   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
     import: 
(&(osgi.wiring.package=javax.annotation)(version>=1.2.0)(!(version>=2.0.0)))
      |
     export: osgi.wiring.package=javax.annotation
   javax.annotation-api [93.0]

Chain 2:
   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
     import: 
(&(osgi.wiring.package=org.springframework.context.annotation)(version>=3.1.0)(!(version>=5.0.0)))
      |
     export: osgi.wiring.package=org.springframework.context.annotation; 
uses:=javax.annotation
   org.apache.servicemix.bundles.spring-context [79.0]
     import: (osgi.wiring.package=javax.annotation)
      |
     export: osgi.wiring.package=javax.annotation
   org.apache.felix.framework [0]
karaf@root()>

Anyone else experiencing this issue?

I see that switching the install (i.e. first installing 'cxf') will make 
it work, however, it seems a klduge to prescribe an installation ordering.


Re: Issue with 'javax.annotation' when installing 'camel' followed by 'cxf' feature

Posted by James Carman <ja...@carmanconsulting.com>.
Which JDK are you using to run Karaf?

On Mon, Apr 6, 2015 at 3:17 PM, Martin Lichtin
<li...@yahoo.com.invalid> wrote:
> In a Karaf 3.0.3 container one cannot install feature 'camel' followed by
> installing 'cxf'.
>
> karaf@root()> feature:repo-add
> mvn:org.apache.camel.karaf/apache-camel/2.15.1/xml/features
> Adding feature url
> mvn:org.apache.camel.karaf/apache-camel/2.15.1/xml/features
>
> karaf@root()> feature:install camel
> karaf@root()> feature:install cxf
> Refreshing bundles org.apache.servicemix.bundles.spring-context (79),
> org.apache.servicemix.bundles.spring-beans (77),
> org.apache.servicemix.bundles.spring-context-support (80),
> org.apache.servicemix.bundles.spring-core (75)
> Error executing command: Can't install feature cxf/0.0.0:
> Could not start bundle
> mvn:org.apache.cxf/cxf-rt-rs-extension-providers/3.0.4 in feature(s)
> cxf-jaxrs-3.0.4: Uses constraint violation. Unable to resolve bundle
> revision org.apache.cxf.cxf-rt-frontend-jaxrs [138.0] because it is exposed
> to package 'javax.annotation' from bundle revisions javax.annotation-api
> [93.0] and org.apache.felix.framework [0] via two dependency chains.
>
> Chain 1:
>   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
>     import:
> (&(osgi.wiring.package=javax.annotation)(version>=1.2.0)(!(version>=2.0.0)))
>      |
>     export: osgi.wiring.package=javax.annotation
>   javax.annotation-api [93.0]
>
> Chain 2:
>   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
>     import:
> (&(osgi.wiring.package=org.springframework.context.annotation)(version>=3.1.0)(!(version>=5.0.0)))
>      |
>     export: osgi.wiring.package=org.springframework.context.annotation;
> uses:=javax.annotation
>   org.apache.servicemix.bundles.spring-context [79.0]
>     import: (osgi.wiring.package=javax.annotation)
>      |
>     export: osgi.wiring.package=javax.annotation
>   org.apache.felix.framework [0]
> karaf@root()>
>
> Anyone else experiencing this issue?
>
> I see that switching the install (i.e. first installing 'cxf') will make it
> work, however, it seems a klduge to prescribe an installation ordering.
>

Re: Issue with 'javax.annotation' when installing 'camel' followed by 'cxf' feature

Posted by Martin Lichtin <li...@yahoo.com>.
JDK 1.8. Karaf's jre.properties has jre-1.8 property with

 javax.annotation;version="1.0", \
 javax.annotation.processing;version="1.6", \

It seems to be an unresolved issue, see
https://issues.apache.org/jira/browse/KARAF-2660

I noticed that if I install "mvn:javax.annotation/javax.annotation-api/1.2"
ahead of installing the 'camel' feature, then I can later install 'cxf'.



James Carman wrote
> You need to update jre.properties to make sure you have the right version
> coming from the jre.  What jdk?
> 
> On Monday, April 6, 2015, Martin Lichtin &lt;

> lichtin@.com

> &gt; wrote:
> 
>> In a Karaf 3.0.3 container one cannot install feature 'camel' followed by
>> installing 'cxf'.
>>
>> karaf@root()> feature:repo-add mvn:org.apache.camel.karaf/
>> apache-camel/2.15.1/xml/features
>> Adding feature url mvn:org.apache.camel.karaf/apache-camel/2.15.1/xml/
>> features
>>
>> karaf@root()> feature:install camel
>> karaf@root()> feature:install cxf
>> Refreshing bundles org.apache.servicemix.bundles.spring-context (79),
>> org.apache.servicemix.bundles.spring-beans (77),
>> org.apache.servicemix.bundles.spring-context-support (80),
>> org.apache.servicemix.bundles.spring-core (75)
>> Error executing command: Can't install feature cxf/0.0.0:
>> Could not start bundle
>> mvn:org.apache.cxf/cxf-rt-rs-extension-providers/3.0.4
>> in feature(s) cxf-jaxrs-3.0.4: Uses constraint violation. Unable to
>> resolve
>> bundle revision org.apache.cxf.cxf-rt-frontend-jaxrs [138.0] because it
>> is exposed to package 'javax.annotation' from bundle revisions
>> javax.annotation-api [93.0] and org.apache.felix.framework [0] via two
>> dependency chains.
>>
>> Chain 1:
>>   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
>>     import: (&(osgi.wiring.package=javax.annotation)(version>=1.2.0)(!(
>> version>=2.0.0)))
>>      |
>>     export: osgi.wiring.package=javax.annotation
>>   javax.annotation-api [93.0]
>>
>> Chain 2:
>>   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
>>     import: (&(osgi.wiring.package=org.springframework.context.
>> annotation)(version>=3.1.0)(!(version>=5.0.0)))
>>      |
>>     export: osgi.wiring.package=org.springframework.context.annotation;
>> uses:=javax.annotation
>>   org.apache.servicemix.bundles.spring-context [79.0]
>>     import: (osgi.wiring.package=javax.annotation)
>>      |
>>     export: osgi.wiring.package=javax.annotation
>>   org.apache.felix.framework [0]
>> karaf@root()>
>>
>> Anyone else experiencing this issue?
>>
>> I see that switching the install (i.e. first installing 'cxf') will make
>> it work, however, it seems a klduge to prescribe an installation
>> ordering.
>>





--
View this message in context: http://camel.465427.n5.nabble.com/Issue-with-javax-annotation-when-installing-camel-followed-by-cxf-feature-tp5765376p5765426.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Issue with 'javax.annotation' when installing 'camel' followed by 'cxf' feature

Posted by James Carman <ja...@carmanconsulting.com>.
https://github.com/apache/karaf/pull/54


On Wednesday, April 8, 2015, Charlie Mordant <cm...@gmail.com> wrote:

> Hi James,
>
> Unfortunately, the problem is not here: camel karaf feature declares
> 'xml-specs-api' (jaxb, javax.annotations, stax, activation and so on) with
> the 2.2.0 version, while all other Apache projects (openjpa, cxf, amq, and
> even Karaf) are exporting the 2.4.0 ones.
> The only solution I found is to rewrite Camel feature pointing on the 2.4.0
> one (or override third parties manifests such as spring-context...). I may
> be wrong, or do not know all solutions.
>
> Regards,
>
> 2015-04-07 3:49 GMT+02:00 James Carman <james@carmanconsulting.com
> <javascript:;>>:
>
> > You need to update jre.properties to make sure you have the right version
> > coming from the jre.  What jdk?
> >
> > On Monday, April 6, 2015, Martin Lichtin <li...@yahoo.com.invalid>
> > wrote:
> >
> > > In a Karaf 3.0.3 container one cannot install feature 'camel' followed
> by
> > > installing 'cxf'.
> > >
> > > karaf@root()> feature:repo-add mvn:org.apache.camel.karaf/
> > > apache-camel/2.15.1/xml/features
> > > Adding feature url mvn:org.apache.camel.karaf/apache-camel/2.15.1/xml/
> > > features
> > >
> > > karaf@root()> feature:install camel
> > > karaf@root()> feature:install cxf
> > > Refreshing bundles org.apache.servicemix.bundles.spring-context (79),
> > > org.apache.servicemix.bundles.spring-beans (77),
> > > org.apache.servicemix.bundles.spring-context-support (80),
> > > org.apache.servicemix.bundles.spring-core (75)
> > > Error executing command: Can't install feature cxf/0.0.0:
> > > Could not start bundle
> > mvn:org.apache.cxf/cxf-rt-rs-extension-providers/3.0.4
> > > in feature(s) cxf-jaxrs-3.0.4: Uses constraint violation. Unable to
> > resolve
> > > bundle revision org.apache.cxf.cxf-rt-frontend-jaxrs [138.0] because it
> > > is exposed to package 'javax.annotation' from bundle revisions
> > > javax.annotation-api [93.0] and org.apache.felix.framework [0] via two
> > > dependency chains.
> > >
> > > Chain 1:
> > >   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
> > >     import: (&(osgi.wiring.package=javax.annotation)(version>=1.2.0)(!(
> > > version>=2.0.0)))
> > >      |
> > >     export: osgi.wiring.package=javax.annotation
> > >   javax.annotation-api [93.0]
> > >
> > > Chain 2:
> > >   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
> > >     import: (&(osgi.wiring.package=org.springframework.context.
> > > annotation)(version>=3.1.0)(!(version>=5.0.0)))
> > >      |
> > >     export: osgi.wiring.package=org.springframework.context.annotation;
> > > uses:=javax.annotation
> > >   org.apache.servicemix.bundles.spring-context [79.0]
> > >     import: (osgi.wiring.package=javax.annotation)
> > >      |
> > >     export: osgi.wiring.package=javax.annotation
> > >   org.apache.felix.framework [0]
> > > karaf@root()>
> > >
> > > Anyone else experiencing this issue?
> > >
> > > I see that switching the install (i.e. first installing 'cxf') will
> make
> > > it work, however, it seems a klduge to prescribe an installation
> > ordering.
> > >
> > >
> >
>
>
>
> --
> Charlie Mordant
>
> Full OSGI/EE stack made with Karaf:
> https://github.com/OsgiliathEnterprise/net.osgiliath.parent
>

Re: Issue with 'javax.annotation' when installing 'camel' followed by 'cxf' feature

Posted by Charlie Mordant <cm...@gmail.com>.
Hi James,

Unfortunately, the problem is not here: camel karaf feature declares
'xml-specs-api' (jaxb, javax.annotations, stax, activation and so on) with
the 2.2.0 version, while all other Apache projects (openjpa, cxf, amq, and
even Karaf) are exporting the 2.4.0 ones.
The only solution I found is to rewrite Camel feature pointing on the 2.4.0
one (or override third parties manifests such as spring-context...). I may
be wrong, or do not know all solutions.

Regards,

2015-04-07 3:49 GMT+02:00 James Carman <ja...@carmanconsulting.com>:

> You need to update jre.properties to make sure you have the right version
> coming from the jre.  What jdk?
>
> On Monday, April 6, 2015, Martin Lichtin <li...@yahoo.com.invalid>
> wrote:
>
> > In a Karaf 3.0.3 container one cannot install feature 'camel' followed by
> > installing 'cxf'.
> >
> > karaf@root()> feature:repo-add mvn:org.apache.camel.karaf/
> > apache-camel/2.15.1/xml/features
> > Adding feature url mvn:org.apache.camel.karaf/apache-camel/2.15.1/xml/
> > features
> >
> > karaf@root()> feature:install camel
> > karaf@root()> feature:install cxf
> > Refreshing bundles org.apache.servicemix.bundles.spring-context (79),
> > org.apache.servicemix.bundles.spring-beans (77),
> > org.apache.servicemix.bundles.spring-context-support (80),
> > org.apache.servicemix.bundles.spring-core (75)
> > Error executing command: Can't install feature cxf/0.0.0:
> > Could not start bundle
> mvn:org.apache.cxf/cxf-rt-rs-extension-providers/3.0.4
> > in feature(s) cxf-jaxrs-3.0.4: Uses constraint violation. Unable to
> resolve
> > bundle revision org.apache.cxf.cxf-rt-frontend-jaxrs [138.0] because it
> > is exposed to package 'javax.annotation' from bundle revisions
> > javax.annotation-api [93.0] and org.apache.felix.framework [0] via two
> > dependency chains.
> >
> > Chain 1:
> >   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
> >     import: (&(osgi.wiring.package=javax.annotation)(version>=1.2.0)(!(
> > version>=2.0.0)))
> >      |
> >     export: osgi.wiring.package=javax.annotation
> >   javax.annotation-api [93.0]
> >
> > Chain 2:
> >   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
> >     import: (&(osgi.wiring.package=org.springframework.context.
> > annotation)(version>=3.1.0)(!(version>=5.0.0)))
> >      |
> >     export: osgi.wiring.package=org.springframework.context.annotation;
> > uses:=javax.annotation
> >   org.apache.servicemix.bundles.spring-context [79.0]
> >     import: (osgi.wiring.package=javax.annotation)
> >      |
> >     export: osgi.wiring.package=javax.annotation
> >   org.apache.felix.framework [0]
> > karaf@root()>
> >
> > Anyone else experiencing this issue?
> >
> > I see that switching the install (i.e. first installing 'cxf') will make
> > it work, however, it seems a klduge to prescribe an installation
> ordering.
> >
> >
>



-- 
Charlie Mordant

Full OSGI/EE stack made with Karaf:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent

Re: Issue with 'javax.annotation' when installing 'camel' followed by 'cxf' feature

Posted by James Carman <ja...@carmanconsulting.com>.
You need to update jre.properties to make sure you have the right version
coming from the jre.  What jdk?

On Monday, April 6, 2015, Martin Lichtin <li...@yahoo.com.invalid> wrote:

> In a Karaf 3.0.3 container one cannot install feature 'camel' followed by
> installing 'cxf'.
>
> karaf@root()> feature:repo-add mvn:org.apache.camel.karaf/
> apache-camel/2.15.1/xml/features
> Adding feature url mvn:org.apache.camel.karaf/apache-camel/2.15.1/xml/
> features
>
> karaf@root()> feature:install camel
> karaf@root()> feature:install cxf
> Refreshing bundles org.apache.servicemix.bundles.spring-context (79),
> org.apache.servicemix.bundles.spring-beans (77),
> org.apache.servicemix.bundles.spring-context-support (80),
> org.apache.servicemix.bundles.spring-core (75)
> Error executing command: Can't install feature cxf/0.0.0:
> Could not start bundle mvn:org.apache.cxf/cxf-rt-rs-extension-providers/3.0.4
> in feature(s) cxf-jaxrs-3.0.4: Uses constraint violation. Unable to resolve
> bundle revision org.apache.cxf.cxf-rt-frontend-jaxrs [138.0] because it
> is exposed to package 'javax.annotation' from bundle revisions
> javax.annotation-api [93.0] and org.apache.felix.framework [0] via two
> dependency chains.
>
> Chain 1:
>   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
>     import: (&(osgi.wiring.package=javax.annotation)(version>=1.2.0)(!(
> version>=2.0.0)))
>      |
>     export: osgi.wiring.package=javax.annotation
>   javax.annotation-api [93.0]
>
> Chain 2:
>   org.apache.cxf.cxf-rt-frontend-jaxrs [138.0]
>     import: (&(osgi.wiring.package=org.springframework.context.
> annotation)(version>=3.1.0)(!(version>=5.0.0)))
>      |
>     export: osgi.wiring.package=org.springframework.context.annotation;
> uses:=javax.annotation
>   org.apache.servicemix.bundles.spring-context [79.0]
>     import: (osgi.wiring.package=javax.annotation)
>      |
>     export: osgi.wiring.package=javax.annotation
>   org.apache.felix.framework [0]
> karaf@root()>
>
> Anyone else experiencing this issue?
>
> I see that switching the install (i.e. first installing 'cxf') will make
> it work, however, it seems a klduge to prescribe an installation ordering.
>
>