Question

For Felix OSGi, loading bundles automatically using a JAR in the Load directory is a snap; and getting a bundle stopped and uninstalled from Felix works well. But, what if you want to delete the file from the Load directory while the Tomcat / Java container is still running? I'd like to remove the JAR file when a user takes an action in my app to uninstall a plugin so that if they issue a restart to the Felix Framework (also a supported UI action), that it doesn't re-discover the JAR and reload the plugin.

When I try to do this, though the file is locked by some other process. Anyone know what might be locking it and how to shut it down so that I can get a lock on the JAR to move / delete it?

NOTE: I have tried shutting down the Felix Framework using

m_fwk.stop();
m_fwk.waitForStop( 0 );

Where m_fwk is a started instance of org.osgi.framework.launch.Framework

No correct solution

OTHER TIPS

Turns out... something was locking my file. Once I figured out what it was, this turned out to have nothing to do with Felix. Anyone who has a similar issue should not believe in the least (as I tended to, since I'm new to OSGi) that the lock on the file was at all related to or a part of the OSGi framework. It wasn't here and almost certainly won't be, even for other frameworks; as I've researched, that would be a major departure from OSGi to begin with.

Anyway, my issue was solved by figuring out what component of the bundle wasn't getting shutdown before I tried to delete the JAR that was being held open because I had inadvertently told it to remain open. GI,GO.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top