if (paths.containsKey(bundle)) {
try {
final Assembler assembler = SystemInstance.get().getComponent(Assembler.class);
if (assembler != null) { // openejb stopped before bundles when shuttind down the OSGi container
assembler.destroyApplication(paths.remove(bundle));
}
} catch (IllegalStateException ise) {
LOGGER.error("Can't undeploy bundle #{0}", bundle.getBundleId());
} catch (UndeployException e) {
LOGGER.error("Can't undeploy bundle #{0}", bundle.getBundleId(), e);