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

Karl Pauls commented on FELIX-6382:
-----------------------------------

[~scott.y], newer versions of bnd do generate imports for java packages. That 
is correct as this is a feature introduced with OSGi R7 (that bundles can have 
imports for java.* packages). The framework should export those from the system 
bundle (and Felix does starting with version 6). Starting with OSGi R8 
(available now with Felix 7), you can even have bundles that provide java 
exports in certain cases (if they are connect bundles). 

I would assume your problem is that Karaf isn't exporting the java packages. It 
likely is overriding the system bundle exports of Felix and doesn't provide the 
java packages. In that case, you either have ask Karaf to change that or you 
have to tell bnd not to generate java imports for your bundles (using 
{{-nojavaimport=true}}. See [0] for more.

[0] https://github.com/bndtools/bnd/issues/2507 

> Bundles failing to resolve because of missing java.* dependencies.
> ------------------------------------------------------------------
>
>                 Key: FELIX-6382
>                 URL: https://issues.apache.org/jira/browse/FELIX-6382
>             Project: Felix
>          Issue Type: Bug
>         Environment: Windows Server 2016, openjdk-14.0.2+12, Bndtools 5.2.0 
> Rel
>            Reporter: Scott Leschke
>            Priority: Major
>
> Not sure how to address this. I previously mentioned this issue on the Karaf 
> user list. I'm trying to upgrade to Karaf 4.3.0 (running under openjdk 14.0) 
> and bundles fail to resolve due to unresolved java.* dependencies.
> I created a bundle with a single class that has a few java.* dependencies and 
> it exhibits the problem as well. I tried compiling the test bundle as 1.8, 9, 
> 11 and 14 and they all behaved the same. The strangest part is that 
> third-party bundles that I rely on, Apache Commons Lang, Google Guava, etc 
> resolve just fine.
> I hesitate to mark this as a Bug since it could be in my environment but I'm 
> at a loss on this at the moment.  I'm using the same version of Bndtools that 
> I used with Karaf 4.2.10 and everything works fine there.
> 2021-01-26T14:52:36,821 | WARN  | fileinstall-E:/BAM | fileinstall            
>           | 17 - org.apache.felix.fileinstall - 3.6.8 | Error while starting 
> bundle: file:/E:/BAM/medline.util.jar2021-01-26T14:52:36,821 | WARN  | 
> fileinstall-E:/BAM | fileinstall                      | 17 - 
> org.apache.felix.fileinstall - 3.6.8 | Error while starting bundle: 
> file:/E:/BAM/medline.util.jarorg.osgi.framework.BundleException: Unable to 
> resolve medline.util [55](R 55.2): missing requirement [medline.util [55](R 
> 55.2)] osgi.wiring.package; (osgi.wiring.package=java.lang) Unresolved 
> requirements: [[medline.util [55](R 55.2)] osgi.wiring.package; 
> (osgi.wiring.package=java.lang)] at 
> org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368) 
> ~[?:?] at org.apache.felix.framework.Felix.startBundle(Felix.java:2281) 
> ~[?:?] at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998) 
> ~[?:?] at 
> org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260)
>  [!/:3.6.8] at 
> org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233)
>  [!/:3.6.8] at 
> org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221)
>  [!/:3.6.8] at 
> org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515)
>  [!/:3.6.8] at 
> org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365)
>  [!/:3.6.8] at 
> org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316)
>  [!/:3.6.8]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to