diff --git a/jboss-integration/src/main/java/org/teiid/jboss/DQPCoreService.java b/jboss-integration/src/main/java/org/teiid/jboss/DQPCoreService.java index 7876214846..a723fa5671 100644 --- a/jboss-integration/src/main/java/org/teiid/jboss/DQPCoreService.java +++ b/jboss-integration/src/main/java/org/teiid/jboss/DQPCoreService.java @@ -102,12 +102,18 @@ public void removed(String name, CompositeVDB vdb) { } // dump the caches. - if (getResultSetCacheInjector().getValue() != null) { - getResultSetCacheInjector().getValue().clearForVDB(vdb.getVDBKey()); - } - if (getPreparedPlanCacheInjector().getValue() != null) { - getPreparedPlanCacheInjector().getValue().clearForVDB(vdb.getVDBKey()); - } + try { + SessionAwareCache value = getResultSetCacheInjector().getValue(); + if (value != null) { + value.clearForVDB(vdb.getVDBKey()); + } + value = getPreparedPlanCacheInjector().getValue(); + if (value != null) { + value.clearForVDB(vdb.getVDBKey()); + } + } catch (IllegalStateException e) { + //already shutdown + } } @Override diff --git a/runtime/src/main/java/org/teiid/deployers/EventDistributorImpl.java b/runtime/src/main/java/org/teiid/deployers/EventDistributorImpl.java index be89e005de..b8667a7963 100644 --- a/runtime/src/main/java/org/teiid/deployers/EventDistributorImpl.java +++ b/runtime/src/main/java/org/teiid/deployers/EventDistributorImpl.java @@ -58,24 +58,36 @@ public EventDistributorImpl() { @Override public void removed(String name, CompositeVDB vdb) { for(EventListener el:EventDistributorImpl.this.listeners) { - el.vdbUndeployed(name, vdb.getVDB().getVersion()); + try { + el.vdbUndeployed(name, vdb.getVDB().getVersion()); + } catch (Exception e) { + LogManager.logError(LogConstants.CTX_RUNTIME, e, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40148, "undeployed", vdb.getVDBKey())); //$NON-NLS-1$ + } } } @Override public void finishedDeployment(String name, CompositeVDB vdb) { for(EventListener el:EventDistributorImpl.this.listeners) { - if (vdb.getVDB().getStatus().equals(Status.ACTIVE)) { - el.vdbLoaded(vdb.getVDB()); - } - else { - el.vdbLoadFailed(vdb.getVDB()); + try { + if (vdb.getVDB().getStatus().equals(Status.ACTIVE)) { + el.vdbLoaded(vdb.getVDB()); + } + else { + el.vdbLoadFailed(vdb.getVDB()); + } + } catch (Exception e) { + LogManager.logError(LogConstants.CTX_RUNTIME, e, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40148, "finished deployment", vdb.getVDBKey())); //$NON-NLS-1$ } } } @Override public void added(String name, CompositeVDB vdb) { for(EventListener el:EventDistributorImpl.this.listeners) { - el.vdbDeployed(name, vdb.getVDB().getVersion()); + try { + el.vdbDeployed(name, vdb.getVDB().getVersion()); + } catch (Exception e) { + LogManager.logError(LogConstants.CTX_RUNTIME, e, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40148, "deployed", vdb.getVDBKey())); //$NON-NLS-1$ + } } } @Override diff --git a/runtime/src/main/java/org/teiid/runtime/RuntimePlugin.java b/runtime/src/main/java/org/teiid/runtime/RuntimePlugin.java index ef21ae4cb9..c9bd8a9c33 100644 --- a/runtime/src/main/java/org/teiid/runtime/RuntimePlugin.java +++ b/runtime/src/main/java/org/teiid/runtime/RuntimePlugin.java @@ -153,6 +153,7 @@ public static enum Event implements BundleUtil.Event{ TEIID40144, TEIID40145, TEIID40146, - TEIID40147 + TEIID40147, + TEIID40148 } } diff --git a/runtime/src/main/resources/org/teiid/runtime/i18n.properties b/runtime/src/main/resources/org/teiid/runtime/i18n.properties index ae8299bd62..14feaed040 100644 --- a/runtime/src/main/resources/org/teiid/runtime/i18n.properties +++ b/runtime/src/main/resources/org/teiid/runtime/i18n.properties @@ -147,3 +147,5 @@ TEIID40144={0} deploy failed - imported vdb {1} is not properly specified. The TEIID40145={0} deploy failed - the version must be fully specified TEIID40147=Invalid integer {0} + +TEIID40148=Uncaught exception calling listener on event {0} for vdb {1}