[ 
https://issues.apache.org/jira/browse/FELIX-3378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13224523#comment-13224523
 ] 

dave c commented on FELIX-3378:
-------------------------------

>It's not clear to me why you are loading an Equinox OSGi framework class while 
>running on the Felix framework
Not clear to me either. Seriously though, the way we get into this state is 
that something in Protege (not our code) is calling 
org/eclipse/osgi/framework/console/CommandProvider. As a profiler, we notice 
that via our injected code - and in this background thread we attempt to load 
the class so we can do our profiling thing - in fact, I expect that the class 
would already have been loaded. 

>Are you saying you are trying to load a class from a bundle in your class that 
>was loaded by the application class loader?
I agree that will never work.  But I don't think that 
org/eclipse/osgi/framework/console/CommandProvider is part of a bundle, since 
it's a framework class. right?

Thanks for the thoughts so far.

                
> class in bootclasspath cannot load osgi framework class
> -------------------------------------------------------
>
>                 Key: FELIX-3378
>                 URL: https://issues.apache.org/jira/browse/FELIX-3378
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>         Environment: Windows7,64bit. Java 1.6 jdk, Protege 4.1, Felix 2.0.4, 
> OSGi R4
>            Reporter: dave c
>              Labels: newbie
>
> I work on a java profiler project.  We have added our package to the 
> bootdelegation path, so our code is found even though no explicit reference 
> exists to our package. The problem seems to come when our code tries to load 
> a class that is not our own.
> I am profiling Protege 4.1. We have some code running in a background thread 
> which gets this error. I looked at the felix code for ModuleImpl, and find 
> nothing obvious. Is there something I'm doing wrong that prevents our thread 
> from finding this class?  Or is this a limitation of the OSGi framework?
> java.lang.NoClassDefFoundError: 
> org/eclipse/osgi/framework/console/CommandProvider
>       at java.lang.ClassLoader.defineClass1(Native Method)
>       at java.lang.ClassLoader.defineClassCond(Unknown Source)
>       at java.lang.ClassLoader.defineClass(Unknown Source)
>       at 
> org.apache.felix.framework.ModuleImpl$ModuleClassLoader.findClass(ModuleImpl.java:1872)
>       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(Unknown Source)
>       at 
> com.myprofiler.InstrumentedMethod.registerForClassDeathNotification(InstrumentedMethod.java:311)
>       at 
> com.myprofiler.InstrumentedMethod.createDeathNotificationsForNewMethods(InstrumentedMethod.java:116)
>       at 
> com.myprofiler.MyProfilerApplication$PeriodicBufferProcessingThread.run(MyProfilerApplication.java:403)
> Caused by: java.lang.ClassNotFoundException: 
> org.eclipse.osgi.framework.console.CommandProvider
>       at java.net.URLClassLoader$1.run(Unknown Source)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at java.net.URLClassLoader.findClass(Unknown Source)
>       at java.lang.ClassLoader.loadClass(Unknown Source)
>       at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>       at java.lang.ClassLoader.loadClass(Unknown Source)
>       at 
> org.apache.felix.framework.ModuleImpl.searchDynamicImports(ModuleImpl.java:1554)
>       at 
> org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:765)
>       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(Unknown Source)
>       ... 11 more
>       
>       
> According  to the maanifest in the bundled felix.jar:
> Bundle-Version: 2.0.4
> Bundle-Name: Apache Felix
> Bundle-Description: OSGi R4 framework.
> Build-Jdk: 1.5.0_22

--
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

        

Reply via email to