I tried adding the LogService to the class in question (ContentPoolProvider) but still get an exception at the line noted below which can't be right as the changed code is just a } at line 155. Maybe this has more to do with the class being stuck in memory somehow?
On Thu, Sep 16, 2010 at 10:13 AM, Carl Hall <[email protected]> wrote: > I've only seen this in development as that's where I redeploy bundles most > actively. Should I change from using the static Logger creation method to > using the OSGi LogService? > > I create my logger like so: > > private static final Logger LOGGER = > LoggerFactory.getLogger(ContentPoolProvider.class); > > and use it like so: > > if (LOGGER.isDebugEnabled()) { > LOGGER.debug("List Children [{}] ", parent.getPath()); > } > > After reloading a few bundles (sometimes more, sometimes less), I'll get > this stacktrace which renders then bundle useless until I restart the > server: > > 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:403) > at java.util.zip.ZipFile.getEntry(ZipFile.java:148) > at java.util.jar.JarFile.getEntry(JarFile.java:208) > at org.apache.felix.framework.util.JarFileX.getEntry(JarFileX.java:61) > at > org.apache.felix.framework.cache.JarContent.getEntryAsBytes(JarContent.java:120) > at > org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1781) > at > org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:758) > at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:61) > at > org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1733) > at java.lang.ClassLoader.loadClass(ClassLoader.java:248) > at > org.sakaiproject.nakamura.files.pool.ContentPoolProvider.listChildren(ContentPoolProvider.java:155) > at > org.apache.sling.jcr.resource.internal.helper.WrappedResourceProvider.listChildren(WrappedResourceProvider.java:65) > ... > 16.09.2010 09:55:34.579 *ERROR* [0:0:0:0:0:0:0:1 [1284645334569] GET /dev/ > HTTP/1.1] org.apache.sling.engine.impl.SlingMainServlet service: Uncaught > Throwable java.lang.NoClassDefFoundError: org/slf4j/Logger > at > org.sakaiproject.nakamura.files.pool.ContentPoolProvider.listChildren(ContentPoolProvider.java:155) > at > org.apache.sling.jcr.resource.internal.helper.WrappedResourceProvider.listChildren(WrappedResourceProvider.java:65) > ... > Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger > at > org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:814) > at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:61) > at > org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1733) > at java.lang.ClassLoader.loadClass(ClassLoader.java:248) > ... 30 more >

