Hey Rickard (or another volunteer),

I get an exception on server shutdown from an MBean I added to 
the server, because it can't find the object I added to JNDI and now 
am trying to remove. (I successfully access this JNDI object during 
execution of the server.) Is there an obvious possibility that leaps to 
mind from peering at the stack trace? My code mirrors that for the 
Tx monitor mbean, i.e.:

   protected void initService()
      throws Exception
   {
           // Create a new SM
           sm = new EJBSecurityManagerDefaultImpl();
           
           // Bind reference to SM in JNDI
           Reference ref = new Reference(sm.getClass().toString(), 
getClass().getName(), null);
           new InitialContext().bind(JNDI_NAME, ref);
   }
   
   protected void stopService()
   {
                try
                {
                        // Remove SM from JNDI
                        new InitialContext().unbind(JNDI_NAME);
                } catch (Exception e)
                {
                        log.exception(e);
                }
   }

Stack trace is as follows:

[Security manager] Stopping
[Security manager] javax.naming.CommunicationException.  Root 
exception is java.rmi.NoSuchObjectException: no such objec
t in table
[Security manager]      at 
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer
(Unknown Source)
[Security manager]      at 
sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
[Security manager]      at 
sun.rmi.server.UnicastRef.invoke(Unknown Source)
[Security manager]      at 
org.jnp.server.NamingServer_Stub.unbind(Unknown Source)
[Security manager]      at 
org.jnp.interfaces.NamingContext.unbind(NamingContext.java:414)
[Security manager]      at 
org.jnp.interfaces.NamingContext.unbind(NamingContext.java:402)
[Security manager]      at 
javax.naming.InitialContext.unbind(Unknown Source)
[Security manager]      at 
org.jboss.security.EJBSecurityManagerService.stopService(EJBSe
curityManagerService.java:90)
[Security manager]      at 
org.jboss.util.ServiceMBeanSupport.stop(ServiceMBeanSupport.jav
a:118)
[Security manager]      at 
org.jboss.util.ServiceMBeanSupport.destroy(ServiceMBeanSupport.j
ava:133)
[Security manager]      at java.lang.reflect.Method.invoke(Native 
Method)
[Security manager]      at 
javax.management.MBeanServer.invoke(MBeanServer.java:1635)
[Security manager]      at 
javax.management.MBeanServer.invoke(MBeanServer.java:1501)
[Security manager]      at org.jboss.Main$2.run(Main.java:178)
[Security manager] Stopped
[Security manager] Destroying
[Security manager] Destroyed

Thanks for any clues you can provide...

-Dan

Reply via email to