[
https://issues.apache.org/jira/browse/FELIX-4640?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
David Bosschaert updated FELIX-4640:
------------------------------------
Attachment: cap.diff
While looking at it, I realized that we're basically constructing the
{{osgi.ee}} capability here for the system bundle, but the system bundle
already has this capability, so I thought it might be easier to copy it. For
example you can find the {{osgi.ee}} capability of the system bundle with the
following code:
{code} Bundle b = context.getBundle(0);
BundleRevision br = b.adapt(BundleRevision.class);
List<Capability> caps = br.getCapabilities("osgi.ee");
System.out.println("caps);{code}
Which prints out:
{noformat}osgi.ee; {osgi.ee=OSGi/Minimum, version=[1.0.0, 1.1.0, 1.2.0]}, [0]
osgi.ee; {osgi.ee=JavaSE, version=[1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0,
1.6.0]}]{noformat}
So I started thinking, would it not be better to simply copy _all_ the
capabilities from the system bundle? I've attached {{cap.diff}} patch that does
this to this issue. This would create a *lot* of capabilities (e.g. every
exported package from the system bundle is also represented as a capability)
but I have the feeling that this is more generic and more complete...
Thoughts anyone?
> missing (&(osgi.ee=JavaSE)(version=1.8)) when embedding in
> org.apache.felix.framework
> -------------------------------------------------------------------------------------
>
> Key: FELIX-4640
> URL: https://issues.apache.org/jira/browse/FELIX-4640
> Project: Felix
> Issue Type: Bug
> Components: Bundle Repository (OBR), Framework
> Environment: any
> Reporter: Jan Winter
> Assignee: David Bosschaert
> Fix For: bundlerepository-2.0.4
>
> Attachments: cap.diff
>
>
> When I try to deploy a bundle from a OBRepo occur the below error
> 'Unsatisfied requirement'.
> g! obr:deploy any.bundle
> Unsatisfied requirement(s):
> ---------------------------
> (&(osgi.ee=JavaSE)(version=1.8))
> I would expect that this capability will be provided by system-bundle.
> g! felix:inspect capability osgi.ee
> org.apache.felix.framework [0] provides:
> ----------------------------------------
> osgi.ee; OSGi/Minimum [1.0.0, 1.1.0, 1.2.0] [UNUSED]
> osgi.ee; JavaSE [1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.7.0,
> 1.8.0]
> *My full runtime environment is.*
> g! lb
> START LEVEL 1
> ID|State |Level|Name
> 0|Active | 0|System Bundle (4.4.0)
> 1|Active | 1|Apache Felix Bundle Repository (2.0.2)
> 2|Active | 1|bndlib (2.3.0.201405100607)
> 3|Active | 1|biz.aQute.repository (2.1.0.062515_230REL)
> 4|Active | 1|Java XML Streaming API (1.0.1.v201004272200)
> 5|Active | 1|JAXP XML (1.3.4.v201005080400)
> 6|Active | 1|Apache Felix Gogo Command (0.14.0)
> 7|Active | 1|Apache Felix Gogo Runtime (0.12.1)
> 8|Active | 1|Apache Felix Gogo Shell (0.10.0.v201212101605)
> I found one related fact in
> 'org.apache.felix.bundlerepository-2.0.2/org.apache.felix.bundlerepository.impl.LocalResourceImpl.java'.
> - declared 'osgi.ee' capabilities from framework-bundle will realized as
> 'ee=JavaSE-1.8' capability
> - but the filter require 1 spitted capability (<java-ee-name> and
> <java-ee-version>) '(&(osgi.ee=JavaSE)(version=1.8))'
> *Here the patch who works for me.*
> 85c85,86
> < cap.addProperty(Capability.EXECUTIONENVIRONMENT,
> tokens.nextToken().trim());
> ---
> > String eeValue = tokens.nextToken().trim();
> >
> > cap.addProperty(Capability.EXECUTIONENVIRONMENT, eeValue);
> 86a88,100
> >
> > String[] split = eeValue.split("-");
> > switch (split.length) {
> > case 2:
> > String osgi_ee = "osgi." +
> > Capability.EXECUTIONENVIRONMENT;
> > CapabilityImpl cap2 = new
> > CapabilityImpl(osgi_ee, new PropertyImpl[]{
> > new
> > PropertyImpl(osgi_ee, null, split[0]),
> > new
> > PropertyImpl("version", null, split[1])
> > });
> > addCapability(cap2);
> > break;
> > }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)