[
https://issues.apache.org/jira/browse/FELIX-5578?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Karl Pauls closed FELIX-5578.
-----------------------------
Resolution: Not A Problem
The problem in your case is that you are installing the Felix framework itself
as a bundle. That, in combination with you manually overriding the system
bundle exports with an export of org.osgi.framework in version 1.6.0 makes it
so that the framework installed as a bundle exports org.osgi.framework in
version 1.8.0 which will make bundles wire to the bundle instead of the system
bundle.
Subsequently, when the bundles gets activated, their BundleActivators are of
the "wrong" type as they get their org.osgi.framework version from the Felix
bundle and not from the system bundle.
Finally, regarding your "letters after o", it turns out that you set the
framework start level to 6 and the bundle start level to 5. That makes it so
that bundles get started directly when they are installed. As a consequence,
bundles always get resolved directly too - hence, the install order is
important as any bundle installed _after_ the Felix bundle will wire
org.osg.framework to the higher version export of that Felix bundle (causing
your Exception). As under Linux a file listing of a dir will return the files
in alphabetical order, you are influencing the install order by renaming. Due
to the Felix bundle starting with "o" (org.apache.felix.main-5.6.2.jar) any
bundle starting with a letter after "o" will be installed after it and get the
exception.
In summary, don't install the Felix framework as a bundle in the Felix
framework and don't override the system bundle exports.
> bundle names starting with letters after o load with ClassCastException
> -----------------------------------------------------------------------
>
> Key: FELIX-5578
> URL: https://issues.apache.org/jira/browse/FELIX-5578
> Project: Felix
> Issue Type: Bug
> Components: Main
> Affects Versions: gogo.runtime-0.16.2
> Environment: Linux
> Reporter: Thomas C Nelson
> Attachments: bug.tar
>
>
> I'll enclose a simple attachment that contains a README.txt. The summary is:
> The felix framework behaves differently with the same jars if the only change
> is the alphabetical name of the jar (if the name starts with p or later there
> is a ClassCastException to BundleActivator). I believe this bug is behind
> many unresolved mysteries regarding ClassCastException to BundleActivator
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)