felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergio Mestre (JIRA)" <j...@apache.org>
Subject [jira] Commented: (FELIX-1197) Bundle Fragments not resolved correctly
Date Wed, 03 Jun 2009 07:34:07 GMT

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

Sergio Mestre commented on FELIX-1197:

Yes that's right. I have two fragments importing nearly the same packages but exporting different
packages. Both fragments should attach the same host.

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