You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Dustin Schultz (Created) (JIRA)" <ji...@apache.org> on 2012/02/29 17:02:00 UTC

[jira] [Created] (FELIX-3368) Class loading fails on shutdown because zip is unreadable

Class loading fails on shutdown because zip is unreadable
---------------------------------------------------------

                 Key: FELIX-3368
                 URL: https://issues.apache.org/jira/browse/FELIX-3368
             Project: Felix
          Issue Type: Bug
          Components: Framework
    Affects Versions: framework-3.2.2
            Reporter: Dustin Schultz


If a particular module executes a shutdown hook which loads a class at runtime, it will fail with NoClassDefFound errors because the classloader will be unable to load the class from the jar.

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:415)
at java.util.zip.ZipFile.getEntry(ZipFile.java:160)
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:1816)
at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:727)
at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doDispose(IndexedDiskCache.java:920)
at

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (FELIX-3368) Class loading fails on shutdown because zip is unreadable

Posted by "Richard S. Hall (Reopened) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard S. Hall reopened FELIX-3368:
------------------------------------

    
> Class loading fails on shutdown because zip is unreadable
> ---------------------------------------------------------
>
>                 Key: FELIX-3368
>                 URL: https://issues.apache.org/jira/browse/FELIX-3368
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-3.2.2
>            Reporter: Dustin Schultz
>
> If a particular module executes a shutdown hook which loads a class at runtime, it will fail with NoClassDefFound errors because the classloader will be unable to load the class from the jar.
> 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:415)
> at java.util.zip.ZipFile.getEntry(ZipFile.java:160)
> 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:1816)
> at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:727)
> at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
> at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doDispose(IndexedDiskCache.java:920)
> at

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (FELIX-3368) Class loading fails on shutdown because zip is unreadable

Posted by "Richard S. Hall (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13219321#comment-13219321 ] 

Richard S. Hall edited comment on FELIX-3368 at 2/29/12 4:44 PM:
-----------------------------------------------------------------

Yes, that is correct. You cannot load classes from a bundle after the framework shuts down. This bug really duplicates FELIX-2128, so you should check the discussion there. However, I'm still inclined to treat this as a  "WON'T FIX".
                
      was (Author: rickhall):
    Yes, that is correct. You cannot load classes from a bundle after the framework shuts down. There is bug really duplicates FELIX-2128, so you should check the discussion there. However, I'm still inclined to treat this as a  "WON'T FIX".
                  
> Class loading fails on shutdown because zip is unreadable
> ---------------------------------------------------------
>
>                 Key: FELIX-3368
>                 URL: https://issues.apache.org/jira/browse/FELIX-3368
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-3.2.2
>            Reporter: Dustin Schultz
>
> If a particular module executes a shutdown hook which loads a class at runtime, it will fail with NoClassDefFound errors because the classloader will be unable to load the class from the jar.
> 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:415)
> at java.util.zip.ZipFile.getEntry(ZipFile.java:160)
> 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:1816)
> at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:727)
> at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
> at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doDispose(IndexedDiskCache.java:920)
> at

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FELIX-3368) Class loading fails on shutdown because zip is unreadable

Posted by "Felix Meschberger (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13219895#comment-13219895 ] 

Felix Meschberger commented on FELIX-3368:
------------------------------------------

Couldn't we just throw ClassNotFoundException in this case ? (or maybe I am just off by a bit ;-) )
                
> Class loading fails on shutdown because zip is unreadable
> ---------------------------------------------------------
>
>                 Key: FELIX-3368
>                 URL: https://issues.apache.org/jira/browse/FELIX-3368
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-3.2.2
>            Reporter: Dustin Schultz
>
> If a particular module executes a shutdown hook which loads a class at runtime, it will fail with NoClassDefFound errors because the classloader will be unable to load the class from the jar.
> 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:415)
> at java.util.zip.ZipFile.getEntry(ZipFile.java:160)
> 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:1816)
> at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:727)
> at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
> at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doDispose(IndexedDiskCache.java:920)
> at

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FELIX-3368) Class loading fails on shutdown because zip is unreadable

Posted by "Richard S. Hall (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13219321#comment-13219321 ] 

Richard S. Hall commented on FELIX-3368:
----------------------------------------

Yes, that is correct. You cannot load classes from a bundle after the framework shuts down. There is bug really duplicates FELIX-2128, so you should check the discussion there. However, I'm still inclined to treat this as a  "WON'T FIX".
                
> Class loading fails on shutdown because zip is unreadable
> ---------------------------------------------------------
>
>                 Key: FELIX-3368
>                 URL: https://issues.apache.org/jira/browse/FELIX-3368
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-3.2.2
>            Reporter: Dustin Schultz
>
> If a particular module executes a shutdown hook which loads a class at runtime, it will fail with NoClassDefFound errors because the classloader will be unable to load the class from the jar.
> 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:415)
> at java.util.zip.ZipFile.getEntry(ZipFile.java:160)
> 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:1816)
> at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:727)
> at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
> at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doDispose(IndexedDiskCache.java:920)
> at

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FELIX-3368) Class loading fails on shutdown because zip is unreadable

Posted by "Richard S. Hall (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13220030#comment-13220030 ] 

Richard S. Hall commented on FELIX-3368:
----------------------------------------

When this topic came up before, I think I looked into changing the exception, but it didn't seem easy to do at the time, since the error happens pretty deep down. Feel free to take a look.
                
> Class loading fails on shutdown because zip is unreadable
> ---------------------------------------------------------
>
>                 Key: FELIX-3368
>                 URL: https://issues.apache.org/jira/browse/FELIX-3368
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-3.2.2
>            Reporter: Dustin Schultz
>
> If a particular module executes a shutdown hook which loads a class at runtime, it will fail with NoClassDefFound errors because the classloader will be unable to load the class from the jar.
> 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:415)
> at java.util.zip.ZipFile.getEntry(ZipFile.java:160)
> 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:1816)
> at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:727)
> at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
> at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doDispose(IndexedDiskCache.java:920)
> at

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (FELIX-3368) Class loading fails on shutdown because zip is unreadable

Posted by "Richard S. Hall (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard S. Hall closed FELIX-3368.
----------------------------------

    Resolution: Duplicate
    
> Class loading fails on shutdown because zip is unreadable
> ---------------------------------------------------------
>
>                 Key: FELIX-3368
>                 URL: https://issues.apache.org/jira/browse/FELIX-3368
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-3.2.2
>            Reporter: Dustin Schultz
>
> If a particular module executes a shutdown hook which loads a class at runtime, it will fail with NoClassDefFound errors because the classloader will be unable to load the class from the jar.
> 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:415)
> at java.util.zip.ZipFile.getEntry(ZipFile.java:160)
> 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:1816)
> at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:727)
> at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
> at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doDispose(IndexedDiskCache.java:920)
> at

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (FELIX-3368) Class loading fails on shutdown because zip is unreadable

Posted by "Richard S. Hall (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard S. Hall closed FELIX-3368.
----------------------------------

    Resolution: Duplicate
    
> Class loading fails on shutdown because zip is unreadable
> ---------------------------------------------------------
>
>                 Key: FELIX-3368
>                 URL: https://issues.apache.org/jira/browse/FELIX-3368
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-3.2.2
>            Reporter: Dustin Schultz
>
> If a particular module executes a shutdown hook which loads a class at runtime, it will fail with NoClassDefFound errors because the classloader will be unable to load the class from the jar.
> 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:415)
> at java.util.zip.ZipFile.getEntry(ZipFile.java:160)
> 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:1816)
> at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:727)
> at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
> at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doDispose(IndexedDiskCache.java:920)
> at

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira