Category: Container Status: ClosedSeverity: HIGH Reported against release: 0.8 Fixed in release: 0.8.2 (Beta Refresh 2)
PROBLEM:On processes that use Component Services, there will sometimes be an
error using the shell to stop the process. The following is some output
from the shell (with logging level "context" turned on):
-----------------------------------------------------------------------
Openwings@root/raven-137.162.138.228/> process -stop
RealtimeMTIService_im-fe25395a_66d14db8_acc2a94c_e8e044e0
context: Processing: process
About to call containerProcess.stop()
containerProcess.stop() threw a NullPtrException
context: Process to stop was null!
RealtimeMTIService_im-fe25395a_66d14db8_acc2a94c_e8e044e0 could not be
stopped. ANALYSIS:Turning on the "container" logging level, and looking at the Container
Manager's log, we observed that the NullPointerException was being
thrown in the Container code.
We looked at the output of the container log file (found in the temp
directory), and found the following:
java.lang.NullPointerException
at
net.jini.discovery.LookupDiscovery$AnnouncementListener.interrupt
(LookupDiscovery.java:165)
at com.mot.openwings.container.jvm.ContainerJVMProcess.stop
(ContainerJVMProcess.java:315)
at com.mot.openwings.container.jvm.ContainerJVM.stopProcess
(ContainerJVM.java:479)
at
com.mot.openwings.container.remote.RemoteContainerConnectorProviderProxy
Impl.stopProcess(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
at sun.rmi.server.UnicastServerRef.dispatch
(UnicastServerRef.java:241)
at sun.rmi.transport.Transport$1.run(Transport.java:142)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:139)
at sun.rmi.transport.tcp.TCPTransport.handleMessages
(TCPTransport.java:443)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run
(TCPTransport.java:643)
at java.lang.Thread.run(Thread.java:484)
Explanation: When the container shuts down a process, it tries to do it
as nicely as possible - first it tries to use a ProcessAccess object
(if the process has registered one) to shut the process down. Then it
tries to interrupt each of the process threads, and finally it kills
the thread group for the process.
This error is occurring in one of the interrupt calls. The thread being
interrupted is actually part of Jini, which is used by Component
Services. That the Jini thread's interrupt throws an exception is
probably a bug in Jini. Nevertheless, we need to make the container
robust enough to handle defects in code run by processes. Therefore
each interrupt call should be protected with a try-catch block. |