Thanks for that - I've managed to get something up and running now (it's quite a major hack-job, but it works). Two things to note: I didn't need the rmm jar, and I had to add "!oracle.jdbc.*" to the Import-Packages statement, otherwise it went looking for some oracle.jdbc.xa stuff, which I'm not using, and not even sure what it is or where the hell I would find the JAR files. Also had to install the 'connector' feature for the javax.resource package (amongst others). The only other issue was that I didn't realise you had to set the packaging to 'bundle'. Oh, and I renamed -osgi.bnd to osgi.bnd, but that's a minor thing.
I also noticed that the MQ client came with a bunch of OSGi JARs, but they didn't really work very well - would have required adding too much stuff that SMX already provides (e.g. a lot of javax.* packages), so I was a bit worried about what that might do. Now I just have to get it working with Ant or Gradle, since we're not a Maven shop here... Many, many thanks, - Andrew Thorburn On Fri, May 18, 2012 at 1:16 PM, James Carman <[email protected]>wrote: > We did have to add javax.resource in as a bundle, too with this set > up. Hope this helps! > > On Thu, May 17, 2012 at 11:50 AM, James Carman > <[email protected]> wrote: > > We created our own bundle that included everything we needed for IBM MQ: > > > > <properties> > > <ibm.mq.version>7.1.0.0</ibm.mq.version> > > </properties> > > > > <dependencies> > > > > <dependency> > > <groupId>com.ibm.mq</groupId> > > <artifactId>com.ibm.mq</artifactId> > > <version>${ibm.mq.version}</version> > > </dependency> > > <dependency> > > <groupId>com.ibm.mq</groupId> > > <artifactId>com.ibm.mq.commonservices</artifactId> > > <version>${ibm.mq.version}</version> > > </dependency> > > <dependency> > > <groupId>com.ibm.mq</groupId> > > <artifactId>com.ibm.mq.headers</artifactId> > > <version>${ibm.mq.version}</version> > > </dependency> > > <dependency> > > <groupId>com.ibm.mq</groupId> > > <artifactId>com.ibm.mq.jmqi</artifactId> > > <version>${ibm.mq.version}</version> > > </dependency> > > <dependency> > > <groupId>com.ibm.mq</groupId> > > <artifactId>com.ibm.mq.pcf</artifactId> > > <version>${ibm.mq.version}</version> > > </dependency> > > <dependency> > > <groupId>com.ibm.mq</groupId> > > <artifactId>com.ibm.mqjms</artifactId> > > <version>${ibm.mq.version}</version> > > </dependency> > > <dependency> > > <groupId>com.ibm.mq</groupId> > > <artifactId>dhbcore</artifactId> > > <version>${ibm.mq.version}</version> > > </dependency> > > <dependency> > > <groupId>com.ibm.mq</groupId> > > <artifactId>rmm</artifactId> > > <version>${ibm.mq.version}</version> > > </dependency> > > <dependency> > > <groupId>com.ibm.mq</groupId> > > <artifactId>cl3-export</artifactId> > > <version>${ibm.mq.version}</version> > > </dependency> > > </dependencies> > > > > <build> > > <plugins> > > <!-- Plugins for creating bundles for WMQ libraries --> > > <plugin> > > <groupId>org.ops4j</groupId> > > <artifactId>maven-pax-plugin</artifactId> > > <version>1.5</version> > > <extensions>true</extensions> > > </plugin> > > <plugin> > > <groupId>org.apache.felix</groupId> > > <artifactId>maven-bundle-plugin</artifactId> > > <version>2.3.7</version> > > <configuration> > > <instructions> > > > > <Bundle-SymbolicName>ibm-wmq-bundle</Bundle-SymbolicName> > > <Bundle-Version>7.1.0.0</Bundle-Version> > > <!-- > > | export wrapped contents: don't use > > Export-Package:* as this bundles everything on the classpath > > --> > > <_exportcontents>*</_exportcontents> > > <Private-Package>!*</Private-Package> > > <!-- > > | each module can override these defaults in > > their osgi.bnd file > > --> > > <_include>-osgi.bnd</_include> > > <Import-Package>!com.ibm.*,*</Import-Package> > > <DynamicImport-Package>*</DynamicImport-Package> > > </instructions> > > </configuration> > > </plugin> > > </plugins> > > </build> > > > > > > The osgi.bnd file just contains: > > > > Embed-Dependency: *;scope=compile|runtime;type=!pom;inline=true > > > > So, you can actually do that in your pom. > > > > On Thu, May 17, 2012 at 6:52 AM, Andrew Thorburn <[email protected]> > wrote: > >> And a quick Google search turns up the following: > >> > http://gnodet.blogspot.co.nz/2008/09/id-like-to-talk-bit-about-third-party.html > >> > >> That seems to apply to my situation, so presumably that's what I should > do, > >> then? That is, one of: Include each JAR inside the component JAR, > extract > >> the classes from the MQ JARs and add them to the component JAR, or > >> re-bundle the MQ JARs so that they're OSGi-compliant. > >> > >> Thanks, > >> > >> - Andrew > >> > >> On Thu, May 17, 2012 at 10:36 PM, Andrew Thorburn <[email protected]> > wrote: > >>> So, I would like to add some libraries to ServiceMix in order to have > >>> a custom component make use of them. In particular, these are free > >>> (but not open) Java MQI jars from IBM Websphere MQ. As far as I can > >>> tell, they are not OSGi-ified, so do I need to - somehow - apply OSGi > >>> to them to make my component see them in SMX? Or can I get away with > >>> just making my component OSGi-ified? Alternatively, is there a way to > >>> bundle them all up inside a single archive (like a WAR)? > >>> > >>> Unfortunately, my knowledge of OSGi is basically non-existent, so I'm > >>> not sure what I should be doing here... > >>> > >>> - Andrew >
