You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "David Humeniuk (Created) (JIRA)" <ji...@apache.org> on 2012/02/13 22:12:59 UTC
[jira] [Created] (FELIX-3350) ClassNotFoundException missing bundle
information when bundle class loader fails to find class
ClassNotFoundException missing bundle information when bundle class loader fails to find class
----------------------------------------------------------------------------------------------
Key: FELIX-3350
URL: https://issues.apache.org/jira/browse/FELIX-3350
Project: Felix
Issue Type: Bug
Components: Framework
Affects Versions: framework-4.0.2
Reporter: David Humeniuk
Priority: Minor
There is code in BundleWiringImpl, line 1460 that will throw a new ClassNotFoundException with bundle information. However, I don't see how this code is reached. A ClassNotFoundException will be thrown by the boot class loader that is not caught if all other methods fail. See partial stack trace below:
Caused by: java.lang.ClassNotFoundException: org.datanucleus.identity.OIDImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at org.apache.felix.framework.BundleWiringImpl.doImplicitBootDelegation(BundleWiringImpl.java:1666)
at org.apache.felix.framework.BundleWiringImpl.searchDynamicImports(BundleWiringImpl.java:1603)
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1439)
--
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-3350) ClassNotFoundException missing
bundle information when bundle class loader fails to find class
Posted by "David Humeniuk (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-3350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13207318#comment-13207318 ]
David Humeniuk commented on FELIX-3350:
---------------------------------------
Should have pasted the entire stack trace, but yes it is coming from the Java serialization code. I'm trying to deserialize an object and it needs to load a class. The class that it needs to load is in another bundle so I would assume that I need to add an import statement to wire the missing package.
> ClassNotFoundException missing bundle information when bundle class loader fails to find class
> ----------------------------------------------------------------------------------------------
>
> Key: FELIX-3350
> URL: https://issues.apache.org/jira/browse/FELIX-3350
> Project: Felix
> Issue Type: Bug
> Components: Framework
> Affects Versions: framework-4.0.2
> Reporter: David Humeniuk
> Priority: Minor
>
> There is code in BundleWiringImpl, line 1460 that will throw a new ClassNotFoundException with bundle information. However, I don't see how this code is reached. A ClassNotFoundException will be thrown by the boot class loader that is not caught if all other methods fail. See partial stack trace below:
> Caused by: java.lang.ClassNotFoundException: org.datanucleus.identity.OIDImpl
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
> at org.apache.felix.framework.BundleWiringImpl.doImplicitBootDelegation(BundleWiringImpl.java:1666)
> at org.apache.felix.framework.BundleWiringImpl.searchDynamicImports(BundleWiringImpl.java:1603)
> at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1439)
--
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-3350) ClassNotFoundException missing
bundle information when bundle class loader fails to find class
Posted by "Richard S. Hall (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-3350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13207385#comment-13207385 ]
Richard S. Hall commented on FELIX-3350:
----------------------------------------
The class we are delegating for may be available, but classes it depends on may not, which would then result in an NCDFE. When we catch the NCDFE, we just return null because that will cause a CNFE to be thrown in the caller. We don't catch the CNFE because that is already the exception type we are expecting to throw if we fail, so we just let it pass through.
Technically, we could catch either and return null if either occurred, but this assumes that the deeper CNFE never returns useful in formation.
> ClassNotFoundException missing bundle information when bundle class loader fails to find class
> ----------------------------------------------------------------------------------------------
>
> Key: FELIX-3350
> URL: https://issues.apache.org/jira/browse/FELIX-3350
> Project: Felix
> Issue Type: Bug
> Components: Framework
> Affects Versions: framework-4.0.2
> Reporter: David Humeniuk
> Priority: Minor
>
> There is code in BundleWiringImpl, line 1460 that will throw a new ClassNotFoundException with bundle information. However, I don't see how this code is reached. A ClassNotFoundException will be thrown by the boot class loader that is not caught if all other methods fail. See partial stack trace below:
> Caused by: java.lang.ClassNotFoundException: org.datanucleus.identity.OIDImpl
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
> at org.apache.felix.framework.BundleWiringImpl.doImplicitBootDelegation(BundleWiringImpl.java:1666)
> at org.apache.felix.framework.BundleWiringImpl.searchDynamicImports(BundleWiringImpl.java:1603)
> at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1439)
--
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-3350) ClassNotFoundException missing
bundle information when bundle class loader fails to find class
Posted by "David Humeniuk (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-3350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13207332#comment-13207332 ]
David Humeniuk commented on FELIX-3350:
---------------------------------------
What I don't understand is why doImplicitBootDelegation catches NoClassDefFoundError when ClassNotFoundException is thrown by loadClass. Looks like it is catching the wrong exception
> ClassNotFoundException missing bundle information when bundle class loader fails to find class
> ----------------------------------------------------------------------------------------------
>
> Key: FELIX-3350
> URL: https://issues.apache.org/jira/browse/FELIX-3350
> Project: Felix
> Issue Type: Bug
> Components: Framework
> Affects Versions: framework-4.0.2
> Reporter: David Humeniuk
> Priority: Minor
>
> There is code in BundleWiringImpl, line 1460 that will throw a new ClassNotFoundException with bundle information. However, I don't see how this code is reached. A ClassNotFoundException will be thrown by the boot class loader that is not caught if all other methods fail. See partial stack trace below:
> Caused by: java.lang.ClassNotFoundException: org.datanucleus.identity.OIDImpl
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
> at org.apache.felix.framework.BundleWiringImpl.doImplicitBootDelegation(BundleWiringImpl.java:1666)
> at org.apache.felix.framework.BundleWiringImpl.searchDynamicImports(BundleWiringImpl.java:1603)
> at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1439)
--
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-3350) ClassNotFoundException missing
bundle information when bundle class loader fails to find class
Posted by "Richard S. Hall (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-3350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13207268#comment-13207268 ]
Richard S. Hall commented on FELIX-3350:
----------------------------------------
It appears your code is getting into implicit boot delegation, which normally shouldn't happen. You'll only get here is the framework thinks that non-bundled code (i.e., code from the application or boot class path) is trying to load a class via a bundle class loader, in which case it delegates to the app class loader.
Is a non-bundled class causing this class load?
> ClassNotFoundException missing bundle information when bundle class loader fails to find class
> ----------------------------------------------------------------------------------------------
>
> Key: FELIX-3350
> URL: https://issues.apache.org/jira/browse/FELIX-3350
> Project: Felix
> Issue Type: Bug
> Components: Framework
> Affects Versions: framework-4.0.2
> Reporter: David Humeniuk
> Priority: Minor
>
> There is code in BundleWiringImpl, line 1460 that will throw a new ClassNotFoundException with bundle information. However, I don't see how this code is reached. A ClassNotFoundException will be thrown by the boot class loader that is not caught if all other methods fail. See partial stack trace below:
> Caused by: java.lang.ClassNotFoundException: org.datanucleus.identity.OIDImpl
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
> at org.apache.felix.framework.BundleWiringImpl.doImplicitBootDelegation(BundleWiringImpl.java:1666)
> at org.apache.felix.framework.BundleWiringImpl.searchDynamicImports(BundleWiringImpl.java:1603)
> at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1439)
--
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