-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OSGI metadata in MANIFEST.MF is missing 'uses:' information #1487
Comments
Looks sane to me. If you provide a PR, I'm willing to have second look. Please ensure, that you add an entry to the |
sratz
added a commit
to sratz/jna
that referenced
this issue
Dec 19, 2022
When multiple versions of JNA are present in a single OSGI environment, it can happen that OSGI computes an incorrect dependency chain, which can lead to exceptions like the following: This can be addressed by enriching the Export-Package metadata with ;uses="..." information [1]. Fixes java-native-access#1487. [1] https://spring.io/blog/2008/10/20/understanding-the-osgi-uses-directive/
benkard
added a commit
to benkard/mulkcms2
that referenced
this issue
Jan 14, 2023
This MR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [net.java.dev.jna:jna](https://github.com/java-native-access/jna) | compile | minor | `5.12.1` -> `5.13.0` | --- ### Release Notes <details> <summary>java-native-access/jna</summary> ### [`v5.13.0`](https://github.com/java-native-access/jna/blob/HEAD/CHANGES.md#Release-5130) [Compare Source](java-native-access/jna@5.12.1...5.13.0) \================ ## Features - [#​1454](java-native-access/jna#1454): Add `c.s.j.p.win32.Psapi.QueryWorkingSetEx` and associated Types - [@​crain-32](https://github.com/Crain-32). - [#​1459](java-native-access/jna#1459): Add `VirtualLock` and `VirtualUnlock` in `c.s.j.p.win32.Kernel32` - [@​matthiasblaesing](https://github.com/matthiasblaesing). - [#​1471](java-native-access/jna#1471): Add `c.s.j.p.win32.Advapi32Util#isCurrentProcessElevated` and associated Types - [@​dbwiddis](https://github.com/dbwiddis). - [#​1474](java-native-access/jna#1474): Add `c.s.j.p.win32.WbemCli#IWbemClassObject.IWbemQualifierSet`, `IWbemServices.GetObject`, `IWbemContext.SetValue` and associated methods - [@​rchateauneu](https://github.com/rchateauneu). - [#​1482](java-native-access/jna#1482): Add multilingual support of `Kernel32Util.formatMessage` - [@​overpathz](https://github.com/overpathz). - [#​1490](java-native-access/jna#1490): Adds support for a custom `SymbolProvider` in `NativeLibrary` & `Library` - [@​soywiz](https://github.com/soywiz). - [#​1491](java-native-access/jna#1491): Update libffi to v3.4.4 - [@​matthiasblaesing](https://github.com/matthiasblaesing). - [#​1487](java-native-access/jna#1487): Add 'uses' information to OSGI metadata in MANIFEST.MF to improve stability of package resolution - [@​sratz](https://github.com/sratz). ## Bug Fixes - [#​1452](java-native-access/jna#1452): Fix memory allocation/handling for error message generation in native library code (`dispatch.c`) - [@​matthiasblaesing](https://github.com/matthiasblaesing). - [#​1460](java-native-access/jna#1460): Fix win32 variant date conversion in DST offest window and with millisecond values - [@​eranl](https://github.com/eranl). - [#​1472](java-native-access/jna#1472): Fix incorrect bitmask in `c.s.j.Pointer#createConstant(int)` - [@​dbwiddis](https://github.com/dbwiddis). - [#​1481](java-native-access/jna#1481): Fix NPE in NativeLibrary when unpacking from classpath is disabled - [@​trespasserw](https://github.com/trespasserw). - [#​1489](java-native-access/jna#1489): Fixes typo in `OpenGL32Util#wglGetProcAddress`, instead of parameter `procName` the hardcoded value `wglEnumGpusNV` was used - [@​soywiz](https://github.com/soywiz). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When multiple versions of JNA are present in a single OSGI environment, it can happen that OSGI computes an incorrect dependency chain, which can lead to exceptions like the following:
This is a known issue in OSGI when metadata is insufficient and can be addressed by enriching the
Export-Package
metadata with;uses="..."
information:https://spring.io/blog/2008/10/20/understanding-the-osgi-uses-directive/
A patch could look like this:
I can open a pull-request to provide a patch.
However, it's a bit fragile to keep maintaining this metadata by hand. A better solution might be to automate the generation of the MANIFEST.MF metadata with
bnd
:https://bnd.bndtools.org/
The text was updated successfully, but these errors were encountered: