-
Notifications
You must be signed in to change notification settings - Fork 131
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
[LOGGING-198] Add proper OSGi uses to export package #337
base: master
Are you sure you want to change the base?
Conversation
Currently there are no use clauses on the export package header, this can lead to classloading problems. This now adds the appropriate use clause to the export header, due to a bug in commons-parent this currently can not be calculated automatically.
I created a backport of this (but sadly there is no way to create a PR yet as no branch exits in this repo): https://github.com/laeubi/commons-logging/tree/1.x to create the base branch I did:
then applied my changes, so if the 1.x branch could be create in this repo I should be able to offer a PR for this as well. |
@garydgregory can you take a look here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
I am just wondering if we can introduce some integration tests that prevent this issue from happening again.
Yes indeed. Please add something like https://github.com/apache/commons-compress/tree/master/src/test/java/org/apache/commons/compress/osgi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add something like https://github.com/apache/commons-compress/tree/master/src/test/java/org/apache/commons/compress/osgi
Otherwise, this will keep on happening.
I don't think this is something I can offer here, it will require a whole bunch of setups and different version to actually show the problem of bad meta-data. |
Are you saying that tests like the Commons Compress example would not catch this kind of issue? I guess we can't know until a test exists... |
The commons compress test only the bundle itself, this issue you will only see when different bundles are used, e.g. to show the problem in this test you will need (or maybe similar):
What then (if anything setup correctly) will happen is that it gets wired to 1.2 API but 1.3 impl and when the log message is issued you will see |
Hello @laeubi and all: Please test 1.3.5-SNAPSHOT from https://repository.apache.org/content/repositories/snapshots/ or a local build from git master |
If I download the snapshot I still see no
|
With a local build I see this:
so it looks like the snapshots are not yet updated!? |
Hi @laeubi |
@garydgregory the download is looking good now! |
Is there any plans for a new 1.3.5 release? And then only question remains is there any chance for a fix in the 1.2.x ... I assume the main problem would be to actually build the release, but it would also work to just download the old jar and update the manifest + version manually. For 1.2.x the manifest should look like this:
|
@laeubi |
Great!
Some people still use 1.2.x and it has the same problem in manifest so we came up with version 1.2.x and 1.3.x used in the same framework and that was where I discovered the issue initially, but I can understand if you say they should better upgrade than care too much about old versions. |
@laeubi |
Currently there are no use clauses on the export package header, this can lead to classloading problems.
This now adds the appropriate use clause to the export header, due to a bug in commons-parent this currently can not be calculated automatically.
Thanks for your contribution to Apache Commons! Your help is appreciated!
Before you push a pull request, review this list:
mvn
; that'smvn
on the command line by itself.