Search code examples
mavenosgijbossfuse

Handling of third party JAR's in Jboss Fuse


I have a CXF service running on Apache ServiceMix 4 and I'm trying to install it on Fuse 6.2 since we're planning a migration from apache servicemix to fuse. The problem is the dependencies. On this particular instance my service depends on javax.jws:

<dependency>  
<groupId>javax.xml.ws</groupId>  
<artifactId>jaxws-api</artifactId>  
<version>2.1</version>  
<type>jar</type>  
<scope>compile</scope>  
</dependency>  

If I add my webservice to a profile I get this error:

Caused by: java.lang.Exception: Unable to start bundle 285: Unresolved constraint in bundle XPTO [285]: Unable to resolve 285.1: missing requirement [285.1] osgi.wiring.package; (&(osgi.wiring.package=javax.jws)(version>=2.0.0)(!(version>=3.0.0)))  

So I tried to manually add jaxws-api v2.1 to the profile:

JBossFuse:admin@root> profile-edit  -b mvn:javax.xml.ws/jaxws-api/2.1 test-xpto  
Adding bundle:mvn:javax.xml.ws/jaxws-api/2.1 to profile:test-xpto version:1.0  

But that throws me an exception saying that

org.osgi.framework.BundleException: Unsupported 'Bundle-ManifestVersion' value: 1  

So with this I have a couple of questions:

1) Is there a way to check which bundle is providing a particular JAR? It appears that version 3.0.0 of javax.jws is installed but I'm usure of what bundle is exporting it.

2) Is there a way to overcome that Bundle-ManifestVersion: 1 for a third party JAR? Without downloading the sources and making a new POM, that is...

3) Must the dependencies always be managed "by hand"? Is there a mechanism for fuse to download, through public maven repositories, all the required jars? After all they are identified on the POM of my project.


Solution

  • For jars that are in bundle form you can install them as bundles.

    For jars that are not in bundle form you need to install them using the "wrap" command. That is probably why you are getting the Bundle-ManifestVersion error because the jar that does not have that property in its manifest file. See here: https://access.redhat.com/documentation/en-US/Fuse_ESB_Enterprise/7.1/html/Deploying_into_the_Container/files/DeployJar-Wrap.html

    If you are deploying individual bundles then yes, the dependencies need to be handled manually. To make life easier, you can put them all in feature files and just deploy the feature file which references all the dependencies. See here:https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html/Deploying_into_the_Container/files/DeployFeatures-Create.html