Author: rareddy
Date: 2010-01-27 17:03:50 -0500 (Wed, 27 Jan 2010)
New Revision: 1785
Modified:
branches/JCA/jboss-integration/src/main/java/org/teiid/jboss/deployers/ConnectorBindingDeployer.java
branches/JCA/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
Log:
TEIID-833 Avoid the NPE during the undeploy
Modified:
branches/JCA/jboss-integration/src/main/java/org/teiid/jboss/deployers/ConnectorBindingDeployer.java
===================================================================
---
branches/JCA/jboss-integration/src/main/java/org/teiid/jboss/deployers/ConnectorBindingDeployer.java 2010-01-27
21:57:58 UTC (rev 1784)
+++
branches/JCA/jboss-integration/src/main/java/org/teiid/jboss/deployers/ConnectorBindingDeployer.java 2010-01-27
22:03:50 UTC (rev 1785)
@@ -100,9 +100,11 @@
String connectorDefinition = data.getConnectionDefinition();
if (connectorDefinition.equals("org.teiid.connector.api.Connector")) {
String connectorName = data.getJndiName();
- ConnectorManager cm =
this.connectorManagerRepository.removeConnectorManager("java:"+connectorName);
- if (cm != null) {
- cm.stop();
+ if (this.connectorManagerRepository != null) {
+ ConnectorManager cm =
this.connectorManagerRepository.removeConnectorManager("java:"+connectorName);
+ if (cm != null) {
+ cm.stop();
+ }
}
log.info("Teiid Connector Stopped = " + connectorName); //$NON-NLS-1$
}
Modified:
branches/JCA/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
---
branches/JCA/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2010-01-27
21:57:58 UTC (rev 1784)
+++
branches/JCA/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2010-01-27
22:03:50 UTC (rev 1785)
@@ -48,6 +48,7 @@
import com.metamatrix.common.comm.api.ServerConnectionFactory;
import com.metamatrix.common.log.LogManager;
+import com.metamatrix.core.MetaMatrixRuntimeException;
import com.metamatrix.core.log.MessageLevel;
import com.metamatrix.dqp.client.ClientSideDQP;
import com.metamatrix.dqp.service.AuthorizationService;
@@ -129,11 +130,14 @@
}
private void stopEngine() {
- ServerConnectionFactory scf = ContainerUtil.lookup(TEIID_RUNTIME);
- // Stop DQP
- ClientSideDQP dqp = scf.getService(ClientSideDQP.class);
- ((DQPCore)dqp).stop();
+ try {
+ ServerConnectionFactory scf = ContainerUtil.lookup(TEIID_RUNTIME);
+ ClientSideDQP dqp = scf.getService(ClientSideDQP.class);
+ ((DQPCore)dqp).stop();
+ } catch(MetaMatrixRuntimeException e) {
+ // this bean is already shutdown
+ }
// Stop socket transport
if (this.socketTransport != null) {