It seems that jetty performs unregistration of mbeans after the bundles are
stopped.
This means the classloader can't load new classes anymore, so it kinda work
if the code only touches already loaded classes.
It would be better to have jetty perform that cleaning while the bundle is
stopping instead of after.
I.e. the mentioned ShutdownThread should run while the bundle is in a
STOPPING state and should make sure everything has been cleaned before
letting the osgi framework move the bundle into the STOPPED state.
If the thread is running as a shutdown hook, the same holds true: the
bundle should have cleaned that before.

It may be fixable in pax-web if that's how you deploy jetty.

Though, while the exception is ugly, it should be quite harmless.

2013/8/1 John D. Ament <[email protected]>

> Hi all
>
> When I shutdown servicemix using osgi:shutdown, I see the following error
> printed to the log:
>
> ERROR: JarContent: Unable to read bytes. (java.lang.IllegalStateException:
> zip file closed)
> java.lang.IllegalStateException: zip file closed
>         at java.util.zip.ZipFile.ensureOpen(ZipFile.java:632)
>         at java.util.zip.ZipFile.getEntry(ZipFile.java:303)
>         at
> org.apache.felix.framework.util.ZipFileX.getEntry(ZipFileX.java:52)
>         at
>
> org.apache.felix.framework.cache.JarContent.getEntryAsBytes(JarContent.java:122)
>         at
>
> org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1856)
>         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:356)
>         at
> org.eclipse.jetty.jmx.MBeanContainer.removeBean(MBeanContainer.java:210)
>         at
> org.eclipse.jetty.jmx.MBeanContainer.doStop(MBeanContainer.java:342)
>         at
>
> org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:84)
>         at
> org.eclipse.jetty.util.thread.ShutdownThread.run(ShutdownThread.java:124)
> Exception in thread "Thread-31" java.lang.NoClassDefFoundError:
> org/eclipse/jetty/util/component/Container
>         at
> org.eclipse.jetty.jmx.MBeanContainer.removeBean(MBeanContainer.java:210)
>         at
> org.eclipse.jetty.jmx.MBeanContainer.doStop(MBeanContainer.java:342)
>         at
>
> org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:84)
>         at
> org.eclipse.jetty.util.thread.ShutdownThread.run(ShutdownThread.java:124)
> Caused by: java.lang.ClassNotFoundException:
> org.eclipse.jetty.util.component.Container not found by
> org.eclipse.jetty.jmx [109]
>         at
>
> org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:812)
>         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:356)
>         ... 4 more
>
>
> It seems to happen after I have my webservices up and running.  Any idea
> how to fix this?
>
> John
>



-- 
-----------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration

Email: [email protected]
Web: http://fusesource.com
Blog: http://gnodet.blogspot.com/

Reply via email to