[ https://issues.apache.org/jira/browse/GERONIMO-3808?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12566283#action_12566283 ]
David Jencks commented on GERONIMO-3808: ---------------------------------------- I don't know how to prove it but I suspect we didn't see this before only by accidentally shutting down the java:comp gbean before the global context gbean. I think we could fix this by modifying the JavaCompContextGBean something like this: private static final Context EMPTY_CONTEXT; static { try { EMPTY_CONTEXT = new ImmutableContext(Collections.emptyMap()); } catch (NamingException e) { throw new RuntimeException("Won't happen", e); } } protected Context getContext() { Context context = RootContext.getComponentContext(); if (context == null) { return EMPTY_CONTEXT; } return context; } However this obscures the rather serious error of accessing java:comp from a thread in which it has not been properly initialized. I'd rather throw a more informative exception than the NPE but not supply an empty context. > NPE during server shutdown > -------------------------- > > Key: GERONIMO-3808 > URL: https://issues.apache.org/jira/browse/GERONIMO-3808 > Project: Geronimo > Issue Type: Bug > Security Level: public(Regular issues) > Reporter: Kevan Miller > Fix For: 2.1 > > > Anybody else seeing these exceptions during server shutdown? > java.lang.NullPointerException > at > org.apache.xbean.naming.context.ContextFlyweight.listBindings(ContextFlyweight.java:92) > at > org.apache.xbean.naming.context.ContextFederation.getFederatedBindings(ContextFederation.java:88) > at > org.apache.xbean.naming.context.AbstractFederatedContext.getBindings(AbstractFederatedContext.java:71) > at > org.apache.xbean.naming.context.AbstractContext.isEmpty(AbstractContext.java:449) > at > org.apache.xbean.naming.context.WritableContext.removeBinding(WritableContext.java:138) > at > org.apache.xbean.naming.context.WritableContext.removeBinding(WritableContext.java:123) > at > org.apache.xbean.naming.context.AbstractContext.removeDeepBinding(AbstractContext.java:387) > at > org.apache.xbean.naming.context.AbstractContext.removeDeepBinding(AbstractContext.java:377) > at > org.apache.geronimo.gjndi.KernelContextGBean.removeBinding(KernelContextGBean.java:206) > at > org.apache.geronimo.gjndi.KernelContextGBean$ContextLifecycleListener.stopping(KernelContextGBean.java:103) > at > org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.fireStoppingEvent(BasicLifecycleMonitor.java:188) > at > org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access$400(BasicLifecycleMonitor.java:44) > at > org.apache.geronimo.kernel.basic.BasicLifecycleMonitor$RawLifecycleBroadcaster.fireStoppingEvent(BasicLifecycleMonitor.java:258) > at > org.apache.geronimo.gbean.runtime.GBeanInstanceState.stop(GBeanInstanceState.java:167) > at > org.apache.geronimo.gbean.runtime.GBeanInstance.stop(GBeanInstance.java:563) > at > org.apache.geronimo.kernel.basic.BasicKernel.stopGBean(BasicKernel.java:423) > at > org.apache.geronimo.gbean.runtime.GBeanInstanceState.stop(GBeanInstanceState.java:180) > at > org.apache.geronimo.gbean.runtime.GBeanInstance.stop(GBeanInstance.java:563) > at > org.apache.geronimo.kernel.basic.BasicKernel.stopGBean(BasicKernel.java:423) > at > org.apache.geronimo.gbean.runtime.GBeanInstanceState.stop(GBeanInstanceState.java:180) > at > org.apache.geronimo.gbean.runtime.GBeanInstance.stop(GBeanInstance.java:563) > at > org.apache.geronimo.kernel.basic.BasicKernel.stopGBean(BasicKernel.java:423) > at > org.apache.geronimo.kernel.config.KernelConfigurationManager$ShutdownHook.run(KernelConfigurationManager.java:316) > at > org.apache.geronimo.kernel.basic.BasicKernel.notifyShutdownHooks(BasicKernel.java:668) > at > org.apache.geronimo.kernel.basic.BasicKernel.shutdown(BasicKernel.java:645) > at > org.apache.geronimo.kernel.util.MainConfigurationBootstrapper$1.run(MainConfigurationBootstrapper.java:76) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.