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

Jean-Baptiste Onofré updated KARAF-4192:
----------------------------------------
    Fix Version/s:     (was: 4.0.7)
                   4.0.8

> java.lang.ClassCastException in 
> org.apache.karaf.features.internal.region.CandidateComparator
> ---------------------------------------------------------------------------------------------
>
>                 Key: KARAF-4192
>                 URL: https://issues.apache.org/jira/browse/KARAF-4192
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-feature
>    Affects Versions: 4.0.3
>            Reporter: Per Kristian Söreide
>            Assignee: Jean-Baptiste Onofré
>             Fix For: 4.1.0, 4.0.8
>
>
> The system bundle will return a String[] {"org.apache.felix.framework", 
> "system.bundle"} on line 57 in CandidateComparator:
> {noformat}
> c = ((Comparable<Object>) 
> cap1.getAttributes().get(BundleNamespace.BUNDLE_NAMESPACE))
>                     
> .compareTo(cap2.getAttributes().get(BundleNamespace.BUNDLE_NAMESPACE));{noformat}
> This is causing a ClassCastException being thrown.
> Equinox will return an ArrayList<String> (seen in the stacktrace)
> Stacktrace:
> {noformat}
> java.lang.ClassCastException: java.util.ArrayList cannot be cast to 
> java.lang.Comparable
>       at 
> org.apache.karaf.features.internal.region.CandidateComparator.compare(CandidateComparator.java:57)
>       at 
> org.apache.karaf.features.internal.region.CandidateComparator.compare(CandidateComparator.java:31)
>       at java.util.TimSort.binarySort(TimSort.java:265)
>       at java.util.TimSort.sort(TimSort.java:208)
>       at java.util.TimSort.sort(TimSort.java:173)
>       at java.util.Arrays.sort(Arrays.java:659)
>       at java.util.Collections.sort(Collections.java:217)
>       at 
> org.apache.karaf.features.internal.region.SubsystemResolveContext.findProviders(SubsystemResolveContext.java:260)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:272)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at 
> org.apache.felix.resolver.Candidates.processCandidates(Candidates.java:637)
>       at 
> org.apache.felix.resolver.Candidates.populateResource(Candidates.java:273)
>       at org.apache.felix.resolver.Candidates.populate(Candidates.java:161)
>       at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:146)
>       at 
> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:220)
>       at 
> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:263)
>       at 
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1079)
>       at 
> org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:975)
>       at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>       at java.lang.Thread.run(Thread.java:745)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to