Hi,
I am attempting to integrate Spring DM with my embedded Felix instance.
I have used Pax Runner with its Spring DM profile to launch my app and it loads
all of the necessary Spring DM bundles for me, and my app works as expected.
I have also launched the Felix Shell with all of the necessary Spring DM
bundles in the auto load directory and my app works as expected.
However, when I instantiate Felix within my existing application (no auto load
directory) Spring DM doesn't work. I am wondering if it is the way I am loading
the Spring DM bundles into my embedded Felix instance. For ease of use I
created a simple custom bundle that only has a BundleActivator in it, and that
activator simply uses the BundleContext passed to it to load and start all of
the Spring DM bundles. I can see all of the bundle lifecycle events for all of
these bundles, so they are getting loaded into Felix successfully.
Here is a little code from the Activator:
public class Activator implements BundleActivator {
public void start(BundleContext context) throws Exception {
...
String[] bundleLocations = new String[]{
"./spring-osgi-2.0.0.M1/lib/com.springsource.org.apache.log4j-1.2.15.jar",
"./spring-osgi-2.0.0.M1/lib/com.springsource.slf4j.api-1.5.6.jar",
"./spring-osgi-2.0.0.M1/lib/com.springsource.slf4j.org.apache.commons.logging-1.5.6.jar",
"./spring-osgi-2.0.0.M1/lib/com.springsource.org.aopalliance-1.0.0.jar",
...
};
for (String bundleLocation : bundleLocations) {
try {
Bundle b = context.installBundle("file:" + bundleLocation);
b.start();
} catch (BundleException ex) {
Logger.getLogger(Activator.class.getName()).log(Level.SEVERE,
null, ex);
}
}
}
public void stop(BundleContext context) throws Exception {
}
}
Does anyone see a glaring problem with this approach and why it doesn't work,
but all of the other ways do work?
Thanks!
==========================
Craig S. Dickson
http://craigsdickson.com
http://twitter.com/craigsdickson
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]