felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (FELIX-1197) Bundle Fragments not resolved correctly
Date Wed, 10 Jun 2009 15:52:07 GMT

     [ https://issues.apache.org/jira/browse/FELIX-1197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Richard S. Hall resolved FELIX-1197.

       Resolution: Fixed
    Fix Version/s: felix-2.0.0

Yes, this was just a bug in the use of a map with incorrect types for values. I guess generics
would have helped in this case. :-)

It is fixed now. If you can test against the trunk, please do and then close this issue if
satisfied. Thanks.

> Bundle Fragments not resolved correctly
> ---------------------------------------
>                 Key: FELIX-1197
>                 URL: https://issues.apache.org/jira/browse/FELIX-1197
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: felix-1.8.0
>            Reporter: Sergio Mestre
>            Assignee: Richard S. Hall
>             Fix For: felix-2.0.0
> Hi all,
> I have the following behaviour, if I try to attach more than one bundle fragment to the
same bundle host.
> java.lang.ClassCastException: org.apache.felix.framework.searchpolicy.ModuleImpl cannot
be cast to [Ljava.lang.Object;
>         at org.apache.felix.framework.FelixResolverState.checkForConflicts(FelixResolverState.java:220)
> ERROR: Error starting file:bundle/org.apache.felix.shell.jar (org.osgi.framework.BundleException:
Unresolved constraint in bundle 31: Unable to merge fragments)
>         at org.apache.felix.framework.FelixResolverState.mergeFragments(FelixResolverState.java:139)
>         at org.apache.felix.framework.Felix$FelixResolver.resolve(Felix.java:3708)
>         at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3091)
>         at org.apache.felix.framework.Felix.startBundle(Felix.java:1439)
>         at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:984)
>         at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:263)
>         at java.lang.Thread.run(Thread.java:619)
> The bundle fragments have been tested separately and they work as they should. 
> ( e.g. Frag A => Host A => O.K.
>           Frag B => Host A => O.K.
> )
> If I try to resolve both bundle fragments than i get the exception above. I took a look
at the source and it seems to me that there is a bug in the FelixResolverState class. Inside
the method checkForConflicts(IModule host, List fragmentList) there is a map definition Map
ipMerged = new HashMap(); where the key is a String and the Value a Object[] . 
> Later on in a for loop the same map is used to store keys from type String and values
from type ModuleImpl. This causes a the above classcast exception in the line 220. 
> Do I have any mistakes in my bundle fragment headers or is this realy a bug ?
> Best regards
> Sergio

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message