I am having a difficulty shutting down (most likely) netty threads.
I've started an embedded OSGi container in two different apps (one client / one server), the server starts an actor, the client sends messages to it (at the moment messaging is only one way).
I issue framework shutdown, which in turn issues bundle shutdowns which in turn on the server triggers a Actor.remote.unregister, actor.stop, and actor.shutdownAll, after which even the OSGi call to waitForStop() returns successfully (thus all OSGi tasks are now also over). Presumably at this stage both the processes should've shutdown. Yet both of them have running threads which now get into trouble (in this case specifically since even the classloaders can no longer work since OSGi has as well shutdown).
Question : Do I need to do anything in addition to unregister/stop/and shutdownAll ? Especially for netty since the active thread seems to be a netty thread.
I did attempt to look up akka documentation but could not find anything specific.
Akka version : 1.1.3
Scala : 2.9.0.1
Thanks
Dhananjay
Logs for reference appended below.
--------------------- Server Log -------------------------
OSGi Framework stopped
ERROR: Bundle akka-combined [1] Unable to get module class path. (java.lang.IllegalStateException: zip file closed)
java.lang.IllegalStateException: zip file closed
at java.util.zip.ZipFile.ensureOpen(ZipFile.java:416)
at java.util.zip.ZipFile.getEntry(ZipFile.java:161)
at org.apache.felix.framework.util.ZipFileX.getEntry(ZipFileX.java:52)
at org.apache.felix.framework.cache.JarContent.getEntryAsContent(JarContent.java:231)
at org.apache.felix.framework.ModuleImpl.calculateContentPath(ModuleImpl.java:620)
at org.apache.felix.framework.ModuleImpl.initializeContentPath(ModuleImpl.java:571)
at org.apache.felix.framework.ModuleImpl.getContentPath(ModuleImpl.java:557)
at org.apache.felix.framework.ModuleImpl.access$800(ModuleImpl.java:72)
at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1850)
at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:752)
at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:72)
at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1807)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at akka.dispatch.MessageDispatcher$$anon$1.run(MessageHandling.scala:167)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
---------------- Client log -----------------
OSGi Framework stopped
ERROR: Bundle akka-combined [1] Unable to get module class path. (java.lang.IllegalStateException: zip file closed)
java.lang.IllegalStateException: zip file closed
ERROR: Bundle akka-combined [1] Unable to get module class path. (java.lang.IllegalStateException: zip file closed)
at java.util.zip.ZipFile.ensureOpen(ZipFile.java:416)
at java.util.zip.ZipFile.getEntry(ZipFile.java:161)
at org.apache.felix.framework.util.ZipFileX.getEntry(ZipFileX.java:52)
at org.apache.felix.framework.cache.JarContent.getEntryAsContent(JarContent.java:231)
at org.apache.felix.framework.ModuleImpl.calculateContentPath(ModuleImpl.java:620)
at org.apache.felix.framework.ModuleImpl.initializeContentPath(ModuleImpl.java:571)
at org.apache.felix.framework.ModuleImpl.getContentPath(ModuleImpl.java:557)
at org.apache.felix.framework.ModuleImpl.access$800(ModuleImpl.java:72)
at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1850)
at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:752)
at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:72)
at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1807)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:443)
at org.jboss.netty.handler.timeout.ReadTimeoutHandler.readTimedOut(ReadTimeoutHandler.java:210)
at org.jboss.netty.handler.timeout.ReadTimeoutHandler$ReadTimeoutTask.run(ReadTimeoutHandler.java:237)
at org.jboss.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:519)
at org.jboss.netty.util.HashedWheelTimer$Worker.notifyExpiredTimeouts(HashedWheelTimer.java:440)
at org.jboss.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:379)
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at java.lang.Thread.run(Thread.java:662)
java.lang.IllegalStateException: zip file closed
at java.util.zip.ZipFile.ensureOpen(ZipFile.java:416)
at java.util.zip.ZipFile.getEntry(ZipFile.java:161)
at org.apache.felix.framework.util.ZipFileX.getEntry(ZipFileX.java:52)
at org.apache.felix.framework.cache.JarContent.getEntryAsContent(JarContent.java:231)
at org.apache.felix.framework.ModuleImpl.calculateContentPath(ModuleImpl.java:620)
at org.apache.felix.framework.ModuleImpl.initializeContentPath(ModuleImpl.java:571)
at org.apache.felix.framework.ModuleImpl.getContentPath(ModuleImpl.java:557)
at org.apache.felix.framework.ModuleImpl.access$800(ModuleImpl.java:72)
at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1850)
at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:752)
at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:72)
at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1807)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:443)
at org.jboss.netty.handler.timeout.ReadTimeoutHandler$ReadTimeoutTask.run(ReadTimeoutHandler.java:239)
at org.jboss.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:519)
at org.jboss.netty.util.HashedWheelTimer$Worker.notifyExpiredTimeouts(HashedWheelTimer.java:440)
at org.jboss.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:379)
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at java.lang.Thread.run(Thread.java:662)
9 Aug, 2011 11:26:03 AM org.jboss.netty.util.HashedWheelTimer
WARNING: An exception was thrown by TimerTask.
java.lang.NullPointerException
at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1853)
at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:752)
at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:72)
at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1807)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:443)
at org.jboss.netty.handler.timeout.ReadTimeoutHandler$ReadTimeoutTask.run(ReadTimeoutHandler.java:239)
at org.jboss.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:519)
at org.jboss.netty.util.HashedWheelTimer$Worker.notifyExpiredTimeouts(HashedWheelTimer.java:440)
at org.jboss.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:379)
at java.lang.Thread.run(Thread.java:662)
--
----------------------------------------------------------------------------------------------------------------------------------
http://blog.dhananjaynene.com twitter:
@dnene google plus:
http://gplus.to/dhananjaynene