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

Karl Pauls commented on FELIX-5913:
-----------------------------------

Tom,

overriding loadClass and breaking the normal classloader delegation is 
necessary. We don't follow the normal delegation model in OSGi. We use 
loadClass to figure out from what bundle we think we need to load the classes 
from and then call findClass on the classloader of that bundle (and there, we 
do delegate to the super.findClass [0] which should load the class from the dex 
of the bundle). 

In other words, please consider if it is possible that we can't find the class 
because it isn't possible to find it based on the OSGi rules. From the top of 
my head, it could be that you didn't set the FRAMEWORK_BUNDLE_PARENT to be 
FRAMEWORK_BUNDLE_PARENT_FRAMEWORK and/or you are not bootdelegation the right 
classes and/or you didn't set the right FRAMEWORK_SYSTEMPACKAGES.  

Granted, it is totally possibly that there is a bug somewhere - however, it is 
unlikely that it is related to not calling super.loadClass, I don't think. Feel 
free to share what your test set-up looks like and what class it can't find. If 
this is a set-up problem, maybe I can spot it. 

[0] 
https://github.com/karlpauls/felix/blob/4c8492deafe839cdfe98a34745055639e4bed6d9/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java#L2122

> Support Android
> ---------------
>
>                 Key: FELIX-5913
>                 URL: https://issues.apache.org/jira/browse/FELIX-5913
>             Project: Felix
>          Issue Type: Wish
>          Components: Framework
>    Affects Versions: framework-6.0.0, framework-6.0.1
>            Reporter: Tom Rutchik
>            Priority: Major
>         Attachments: BundleWiringImpl.java, 
> FelixAndroidSupportImplementationNotes.pdf
>
>   Original Estimate: 3h
>  Remaining Estimate: 3h
>
> The lastest 6.0.0 and 6.0.1 release no longer works on Android.
> The code form the 5.6.10 version necessary to make it work was not ported 
> into these versions.
> Some code needs to be added to the class BundleWiringImpl class to allow for 
> android support. All of the code necessary to due that can be found in the 
> 5.6.10 version.
> I've added the code and have tested it and it's working fine again.  I've 
> attached an implementation of BundleWiringImpl that works with android. It's 
> basically the 6.0.1 implementation with the extra code from 5.6.10.  You 
> should be able to do a file diff on the 6.0.1 to see where I had to add the 
> missing code.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to