Hello,
There is no any osgi dependencies in the pom.xml file!  If 
OSGI-INF/blueprint/*.xml included into bundle, the 
“org.osgi.service.blueprint;version="[1.0.0,2.0.0)” will be generated; if 
remove OSGI-INF/blueprint/*.xml, then 
“org.osgi.service.blueprint;version="[1.0.0,2.0.0)” was gone.

How to control this meta info?
I’ve tried adding this into the pom.xml
<!--Import-Package>
!org.osgi.service.blueprint
          </Import-Package-->
But not works.

Thanks.
Xilai
From: Freeman Fang [mailto:[email protected]]
Sent: Wednesday, November 23, 2011 1:37 PM
To: [email protected]
Subject: Re: Package uses conflict: Import-Package: org.osgi.service.blueprint

Hi,

maven-bundle-plugin basically just analyze the dependency in pom.xml and 
generate OSGi meta-data header in MANIFEST.MF accordingly, you need check if 
your dependency introduce this package import.
Btw, you can configure the maven-bundle-plugin to totally control the OSGi 
meta-data header.

Freeman

On 2011-11-23, at 下午1:27, XiLai Dai wrote:


Thanks Freeman for your clear reply!

BTW, I’ve run another test with the same bundle which just removed the 
“org.osgi.service.blueprint;version="[1.0.0,2.0.0)” from MANIFEST.MF, then, it 
has been installed into Karaf successfully.
So, maybe it’s a problem from maven-bundle-plugin, it should not generate the 
unexpected “org.osgi.service.blueprint;version="[1.0.0,2.0.0)” into MANIFEST.MF.

Thanks.
Xilai
From: Freeman Fang [mailto:[email protected]]
Sent: Wednesday, November 23, 2011 11:52 AM
To: [email protected]<mailto:[email protected]>
Subject: Re: Package uses conflict: Import-Package: org.osgi.service.blueprint

Hi,

This kind of "Package uses conflict" comes from the scenario like, let's say,
bundle A import-package org.osgi.service.blueprint; version="[1.0.0,2.0.0)", 
bundle A also import-package x.y.z
bunde B export-package  x.y.z with "use" directive like 
uses:="org.osgi.service.blueprint; version="[2.0.0,3.0.0)""
Let's say bundle B already get resolved and started.
When resolve bundle A, it will use export-package x.y.z from bundle B, but  as 
bundle B export-package  x.y.z uses:="oorg.osgi.service.blueprint; 
version="[2.0.0,3.0.0)" and bundle B get resolved to import 
org.osgi.service.blueprint; version="[2.0.0,3.0.0), so it's not meet bundle A's 
restriction which need org.osgi.service.blueprint; 
version="[1.0.0,2.0.0)(notice the version mismatch between the two), then you 
see such exception.

The root cause is that you install some bundles which need different 
org.osgi.service.blueprint versions, also those bundles has dependency with 
each other, you need figure it out from your bundles and fix it.

Freeman
On 2011-11-23, at 上午11:36, XiLai Dai wrote:



Hello,

We have a bundle with blueprint (OSGI-INF/blueprint/xxx.xml) and build with 
maven-bundle-plugin.
The META-INF/ MANIFEST.MF contains:
......
Import-Package: ...,org.osgi.service.blueprint;version="[1.0.0,2.0.0)",...

When install this bundle into Karaf 2.2.4, got error:
Reason: Package uses conflict: Im port-Package: org.osgi.service.blueprint; 
version="[1.0.0,2.0.0)"

Why it complains there has conflict?

Thanks.
Xilai

---------------------------------------------
Freeman Fang

FuseSource
Email:f<mailto:[email protected]>[email protected]<mailto:[email protected]>
Web: fusesource.com<http://fusesource.com/>
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com










---------------------------------------------
Freeman Fang

FuseSource
Email:f<mailto:[email protected]>[email protected]<mailto:[email protected]>
Web: fusesource.com<http://fusesource.com/>
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com









Reply via email to