You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by "Baldo, Federico" <fe...@eurotech.com> on 2015/08/21 12:28:01 UTC

third-party library dependencies

Hello all,
I am new to osgi in general so apologies in advance if I am not entirely correct in the description of the issue I am facing. I started using the aws-java-sdk/1.10.0_1 bundle in order to fetch some objects from s3, although at runtime I am getting a class not found exception while using the standard code path of the sdks on a  dependency that should be imported by the aws-java-sdk bundle.


Caused by: java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/JsonMappingException
        at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:336)
        at com.acme.cloud.commons.util.Config.getRemoteConfig(Config.java:441)
        at com.acme.cloud.commons.util.Config.<clinit>(Config.java:343)
        at com.acme.cloud.assistant.AmqAssistantBrokerActivator.start(AmqAssistantBrokerActivator.java:65)
        at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
        at org.apache.felix.framework.Felix.doActivateBundle(Felix.java:2387)
        ... 21 more
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.JsonMappingException not found by org.apache.servicemix.bundles.aws-java-sdk [163]
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
        at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_85]
        ... 27 more

Checking the pom.xml for aws-java-sdk/1.10.0_1 I can see that the dependecy on  com.fasterxml.jackson is declared as optional:
https://git-wip-us.apache.org/repos/asf?p=servicemix-bundles.git;a=blob_plain;f=aws-java-sdk-1.10.0/pom.xml

When installing a bundle such as the aws sdk, as a user I am expecting that everything will be provided, is this assumption wrong when dealing with third-party bundles?
As a workaround now I am explicitly specifying com.fasterxml.jackson.core as a bundle in my karaf feature file, is this the correct way to deal with this? 

I am a little bit worried about the maintainability of the feature file in case using a lot of third-party library and keeping all their dependencies up to date. What is your experience with that?

Thanks,
Federico