All,
Based on a suggestion from a previous e-mail, I created a Activator class that
calls the executable of the .jar I'm trying to bundle. The goal is to have the
bundle perform the same action as the .jar file, only inside of Karaf. What I
didn't know at the time, was that all of my developers are simply calling
org.apache.camel.spring.Main as thier executable class in thier .jar files.
So, I created an Activator that looks like this:
package mybundle.module1; import org.osgi.framework.BundleActivator; import
org.osgi.framework.BundleContext; import org.apache.camel.spring.Main; public
class Activator implements BundleActivator { private BundleContext context;
public void start(BundleContext context) throws Exception{ this.context
= context; try { Main.main(); } catch (Exception e) {
System.out.pringln( e.toString()); } } public void
stop(BundleContext context) throws Exception{ this.context = null } }
I then modified my pom.xml file and successfully compiled the bundle. A review
of the MANIFEST.MF file shows that the proper bundle-activator is present, and
I imported the org.osgi.framework.* version from the system bundle.
Upon deployment of this file, I get an error which states that Karaf-Spring
cannot file my META-INF/spring/*.xml files. However, an inspection of the .jar
file shows those files are present.
More background: I do not have spring-dm installed, only the appropriate spring
and camel features.
So, I have a few questions:
1) is there a better way to do this?
2) if not, how I can expose the META-INF/spring/*.xml classes to KARAF so it
can find them?
3) how would I attempt to do the same using Spring DM?
4) does anyone have an aspirin? :-)
v/r,
Mike Van