You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by jefoy1101 <je...@gmail.com> on 2015/01/20 18:15:44 UTC

How To Resolve Conflicting Dependencies?

I have mycustom.jar (using guava 18) and I need
cassandra-driver-core_2_3.jar(using guava 14.0.1)

I have other jars installed using etc/myconfig.cfg specifying my custom_lib
folder in karaf 3.0.2
How do you resolve this issue?

I was thinking make mycustom.jar as KAR, but not sure yet how to do it, and
not sure if it the right approach to do this certain type issues.



common.base' from bundle revisions com.google.guava [117.0] and
com.google.guava [75.0] via two dependency chains.

Chain 1:
  adgateway-domain [116.0]
    import:
(&(osgi.wiring.package=com.google.common.base)(version>=15.0.0)(!(version>=16.0.0)))
     |
    export: osgi.wiring.package=com.google.common.base
  com.google.guava [117.0]

Chain 2:
  adgateway-domain [116.0]
    import:
(&(osgi.wiring.package=com.datastax.driver.core.exceptions)(version>=2.0.0)(!(version>=3.0.0)))
     |
    export: osgi.wiring.package=com.datastax.driver.core.exceptions;
uses:=com.google.common.util.concurrent
  com.datastax.driver.core [70.0]
    import:
(&(osgi.wiring.package=com.google.common.util.concurrent)(version>=14.0.0)(!(version>=15.0.0)))
     |
    export: osgi.wiring.package=com.google.common.util.concurrent;
uses:=com.google.common.base
    export: osgi.wiring.package=com.google.common.base
  com.google.guava [75.0]
	at
org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3980)[org.apache.felix.framework-4.2.1.jar:]





--
View this message in context: http://karaf.922171.n3.nabble.com/How-To-Resolve-Conflicting-Dependencies-tp4037875.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: How To Resolve Conflicting Dependencies?

Posted by jefoy1101 <je...@gmail.com>.
1/ you don't export the package in each bundle, you just create one
bundle that does the export

 >> they(myCustom.ja & cassandra.jar) both need to have their own version of
guava, so not sure how to do this?

2/ instead of exporting the package, you define the package as private,
like this each bundle embeds the packages (and hide to the others) 
>> How do you define the package as private? 



--
View this message in context: http://karaf.922171.n3.nabble.com/How-To-Resolve-Conflicting-Dependencies-tp4037875p4037880.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: How To Resolve Conflicting Dependencies?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
You have two ways:
1/ you don't export the package in each bundle, you just create one 
bundle that does the export
2/ instead of exporting the package, you define the package as private, 
like this each bundle embeds the packages (and hide to the others)

Regards
JB

On 01/20/2015 06:15 PM, jefoy1101 wrote:
> I have mycustom.jar (using guava 18) and I need
> cassandra-driver-core_2_3.jar(using guava 14.0.1)
>
> I have other jars installed using etc/myconfig.cfg specifying my custom_lib
> folder in karaf 3.0.2
> How do you resolve this issue?
>
> I was thinking make mycustom.jar as KAR, but not sure yet how to do it, and
> not sure if it the right approach to do this certain type issues.
>
>
>
> common.base' from bundle revisions com.google.guava [117.0] and
> com.google.guava [75.0] via two dependency chains.
>
> Chain 1:
>    adgateway-domain [116.0]
>      import:
> (&(osgi.wiring.package=com.google.common.base)(version>=15.0.0)(!(version>=16.0.0)))
>       |
>      export: osgi.wiring.package=com.google.common.base
>    com.google.guava [117.0]
>
> Chain 2:
>    adgateway-domain [116.0]
>      import:
> (&(osgi.wiring.package=com.datastax.driver.core.exceptions)(version>=2.0.0)(!(version>=3.0.0)))
>       |
>      export: osgi.wiring.package=com.datastax.driver.core.exceptions;
> uses:=com.google.common.util.concurrent
>    com.datastax.driver.core [70.0]
>      import:
> (&(osgi.wiring.package=com.google.common.util.concurrent)(version>=14.0.0)(!(version>=15.0.0)))
>       |
>      export: osgi.wiring.package=com.google.common.util.concurrent;
> uses:=com.google.common.base
>      export: osgi.wiring.package=com.google.common.base
>    com.google.guava [75.0]
> 	at
> org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3980)[org.apache.felix.framework-4.2.1.jar:]
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/How-To-Resolve-Conflicting-Dependencies-tp4037875.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: How To Resolve Conflicting Dependencies?

Posted by jefoy1101 <je...@gmail.com>.
Thanks JB I just tried it and it's still giving me the same exception



--
View this message in context: http://karaf.922171.n3.nabble.com/How-To-Resolve-Conflicting-Dependencies-tp4037875p4037877.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: How To Resolve Conflicting Dependencies?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

did you try a bundle:refresh (without argument) ?

Regards
JB

On 01/20/2015 06:15 PM, jefoy1101 wrote:
> I have mycustom.jar (using guava 18) and I need
> cassandra-driver-core_2_3.jar(using guava 14.0.1)
>
> I have other jars installed using etc/myconfig.cfg specifying my custom_lib
> folder in karaf 3.0.2
> How do you resolve this issue?
>
> I was thinking make mycustom.jar as KAR, but not sure yet how to do it, and
> not sure if it the right approach to do this certain type issues.
>
>
>
> common.base' from bundle revisions com.google.guava [117.0] and
> com.google.guava [75.0] via two dependency chains.
>
> Chain 1:
>    adgateway-domain [116.0]
>      import:
> (&(osgi.wiring.package=com.google.common.base)(version>=15.0.0)(!(version>=16.0.0)))
>       |
>      export: osgi.wiring.package=com.google.common.base
>    com.google.guava [117.0]
>
> Chain 2:
>    adgateway-domain [116.0]
>      import:
> (&(osgi.wiring.package=com.datastax.driver.core.exceptions)(version>=2.0.0)(!(version>=3.0.0)))
>       |
>      export: osgi.wiring.package=com.datastax.driver.core.exceptions;
> uses:=com.google.common.util.concurrent
>    com.datastax.driver.core [70.0]
>      import:
> (&(osgi.wiring.package=com.google.common.util.concurrent)(version>=14.0.0)(!(version>=15.0.0)))
>       |
>      export: osgi.wiring.package=com.google.common.util.concurrent;
> uses:=com.google.common.base
>      export: osgi.wiring.package=com.google.common.base
>    com.google.guava [75.0]
> 	at
> org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3980)[org.apache.felix.framework-4.2.1.jar:]
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/How-To-Resolve-Conflicting-Dependencies-tp4037875.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com