3 Replies Latest reply on Feb 17, 2006 2:27 PM by jrw

    Error accessing data source from MBean.stopService()

    jrw Newbie

      We are running JBoss 4.0.2 with MySQL Database Server 4.1.7.

      We are attempting to access the database from our MBean's stopService() method during server shutdown since we need to do some cleanup before the MBean can shutdown.

      We are getting the error: "javax.naming.NameNotFoundException: DefaultDS not bound."

      The MBean in question is deployed with the following bit of XML:

      <server>
      <classpath codebase='.' archives='*' /> <mbean code="com.enterasys.netsight.server.jmx.NetSightMBean" name="com.enterasys.netsight.server.jmx:service=NetSightMBean">
      <depends>jboss.jca:service=LocalTxCM,name=DefaultDS</depends>
      <depends>jboss.mq.destination:service=Topic,name=adminTopic</depends>
       <depends>jboss.mq:service=InvocationLayer,type=UIL2</depends>
      <depends>jboss.mq:service=InvocationLayer,type=JVM</depends>
      </mbean>
      </server>
      


      I suspect that the JBoss shutdown process is closing the DefaultDS before our MBean's stop is called.

      We did not experience this problem with JBoss 3.2.6.

      We are getting the following error


      Full Error:
      ------------------------------------------------------------------------------------
      2006-02-09 11:52:03,472 INFO [org.jboss.system.server.Server] JBoss SHUTDOWN: Undeploying all packages
      2006-02-09 11:52:06,534 ERROR [STDERR] com.enterasys.netsight.database.exception.DataAccessException: J2EE DataSource Exception
      2006-02-09 11:52:06,534 ERROR [STDERR] at com.enterasys.netsight.database.pool.JndiConnectionPoolManager.getDataSource(JndiConnectionPoolManager.java:54)
      2006-02-09 11:52:06,534 ERROR [STDERR] at com.enterasys.netsight.database.BaseDatabaseContext.getDataSource(BaseDatabaseContext.java:125)
      2006-02-09 11:52:06,534 ERROR [STDERR] at com.enterasys.netsight.database.mysql.MySqlJ2eeDatabaseContext.getPersistenceManager(MySqlJ2eeDatabaseContext.java:48)
      2006-02-09 11:52:06,550 ERROR [STDERR] at com.enterasys.netsight.server.ServerContext.getPersistanceManager(ServerContext.java:231)
      2006-02-09 11:52:06,550 ERROR [STDERR] at com.enterasys.netsight.server.device.DeviceServiceImpl.getAllDevices(DeviceServiceImpl.java:450)
      2006-02-09 11:52:06,550 ERROR [STDERR] at com.enterasys.netsight.server.jmx.NetSightMBean.testDatabaseOp(NetSightMBean.java:405)
      2006-02-09 11:52:06,550 ERROR [STDERR] at com.enterasys.netsight.server.jmx.NetSightMBean.stopService(NetSightMBean.java:134)
      2006-02-09 11:52:06,550 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalStop(ServiceMBeanSupport.java:320)
      2006-02-09 11:52:06,566 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.stop(ServiceMBeanSupport.java:183)
      2006-02-09 11:52:06,566 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalDestroy(ServiceMBeanSupport.java:356)
      2006-02-09 11:52:06,581 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.destroy(ServiceMBeanSupport.java:198)
      2006-02-09 11:52:06,581 ERROR [STDERR] at com.enterasys.netsight.server.jmx.NetSightMBean.invoke(NetSightMBean.java:283)
      2006-02-09 11:52:06,581 ERROR [STDERR] at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:150)
      2006-02-09 11:52:06,581 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      2006-02-09 11:52:06,581 ERROR [STDERR] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:914)
      2006-02-09 11:52:06,581 ERROR [STDERR] at $Proxy0.destroy(Unknown Source)
      2006-02-09 11:52:06,581 ERROR [STDERR] at org.jboss.system.ServiceController.destroy(ServiceController.java:567)
      2006-02-09 11:52:06,597 ERROR [STDERR] at org.jboss.system.ServiceController.destroy(ServiceController.java:558)
      2006-02-09 11:52:06,597 ERROR [STDERR] at org.jboss.system.ServiceController.destroy(ServiceController.java:558)
      2006-02-09 11:52:06,597 ERROR [STDERR] at org.jboss.system.ServiceController.destroy(ServiceController.java:558)
      2006-02-09 11:52:06,597 ERROR [STDERR] at org.jboss.system.ServiceController.destroy(ServiceController.java:558)
      2006-02-09 11:52:06,613 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
      2006-02-09 11:52:06,613 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      2006-02-09 11:52:06,613 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      2006-02-09 11:52:06,613 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      2006-02-09 11:52:06,613 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      2006-02-09 11:52:06,613 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      2006-02-09 11:52:06,628 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      2006-02-09 11:52:06,628 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      2006-02-09 11:52:06,628 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      2006-02-09 11:52:06,628 ERROR [STDERR] at $Proxy4.destroy(Unknown Source)
      2006-02-09 11:52:06,644 ERROR [STDERR] at org.jboss.deployment.SARDeployer.destroy(SARDeployer.java:347)
      2006-02-09 11:52:06,644 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2006-02-09 11:52:06,644 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      2006-02-09 11:52:06,644 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      2006-02-09 11:52:06,644 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      2006-02-09 11:52:06,659 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      2006-02-09 11:52:06,659 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      2006-02-09 11:52:06,659 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
      2006-02-09 11:52:06,659 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      2006-02-09 11:52:06,659 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      2006-02-09 11:52:06,675 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      2006-02-09 11:52:06,675 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      2006-02-09 11:52:06,675 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      2006-02-09 11:52:06,675 ERROR [STDERR] at org.jboss.mx.util.JMXInvocationHandler.invoke(JMXInvocationHandler.java:273)
      2006-02-09 11:52:06,675 ERROR [STDERR] at $Proxy25.destroy(Unknown Source)
      2006-02-09 11:52:06,691 ERROR [STDERR] at org.jboss.deployment.XSLSubDeployer.destroy(XSLSubDeployer.java:239)
      2006-02-09 11:52:06,691 ERROR [STDERR] at org.jboss.deployment.MainDeployer.destroy(MainDeployer.java:665)
      2006-02-09 11:52:06,691 ERROR [STDERR] at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:606)
      2006-02-09 11:52:06,691 ERROR [STDERR] at org.jboss.deployment.MainDeployer.shutdown(MainDeployer.java:492)
      2006-02-09 11:52:06,691 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2006-02-09 11:52:06,706 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      2006-02-09 11:52:06,706 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      2006-02-09 11:52:06,706 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      2006-02-09 11:52:06,706 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      2006-02-09 11:52:06,722 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      2006-02-09 11:52:06,722 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
      2006-02-09 11:52:06,722 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      2006-02-09 11:52:06,722 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      2006-02-09 11:52:06,722 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      2006-02-09 11:52:06,738 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      2006-02-09 11:52:06,738 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      2006-02-09 11:52:06,738 ERROR [STDERR] at org.jboss.system.server.ServerImpl$ShutdownHook.shutdownDeployments(ServerImpl.java:952)
      2006-02-09 11:52:06,738 ERROR [STDERR] at org.jboss.system.server.ServerImpl$ShutdownHook.shutdown(ServerImpl.java:927)
      2006-02-09 11:52:06,738 ERROR [STDERR] at org.jboss.system.server.ServerImpl$ShutdownHook.run(ServerImpl.java:915)
      2006-02-09 11:52:06,753 ERROR [STDERR] Caused by: javax.naming.NameNotFoundException: DefaultDS not bound
      2006-02-09 11:52:06,753 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
      2006-02-09 11:52:06,753 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
      2006-02-09 11:52:06,753 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
      2006-02-09 11:52:06,769 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
      2006-02-09 11:52:06,769 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
      2006-02-09 11:52:06,769 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
      2006-02-09 11:52:06,769 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:351)
      2006-02-09 11:52:06,769 ERROR [STDERR] at com.enterasys.netsight.database.pool.JndiConnectionPoolManager.getDataSource(JndiConnectionPoolManager.java:48)