-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Jetty-util contains wrong Import-Package #5830
Comments
@akurtakov thanks for the report. That is very odd, I cannot see why the maven-bundle-plugin is producing an Import-Package statement for "com.sun.nio.file", I'll look into it. I do note though that our osgi tests don't fail when we deploy jetty-util, so there must be something different about our environments, any clue what it could be? |
My guess would be that the target platform you run your osgi tests against contains a.jre.javase IU for older Java version and thus contains the com.sun.nio.file package. |
@akurtakov I've narrowed this down to this line in
That seems to cause the maven-bundle-plugin to generate the
I'm assuming that |
This is acheived by using the 3-arg Class.forName() method call. The bnd tool which generates the osgi manifests doesn't seem to include Import-Package statements for the 3-arg method call, but does for the 1-arg method call. The speculative loading of the com.sun.nio.file.SensitivityWatchEventModifier will probably be removed in jetty-10 onwards. Signed-off-by: Jan Bartel <[email protected]>
Raised PR #5838 |
Signed-off-by: Jan Bartel <[email protected]>
Will this land in Jetty 10 branch too? |
@akurtakov yes we merge from branch |
* Issue #5830 Remove native classes from PathWatcher. Removed use of com.sun.nio.file.SensitivityWatchEventModifier, no longer needed. This has the desirable side-effect of getting rid of com.sun.nio.file package imports. Signed-off-by: Jan Bartel <[email protected]>
Fixed by #5838. |
Jetty version
10.0.0
Java version
openjdk version "11.0.9.1" 2020-11-04
OpenJDK Runtime Environment 18.9 (build 11.0.9.1+1)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.9.1+1, mixed mode, sharing)
OS type/version
Fedora 33
Description
Trying to use jetty-util in osgi context fails to resolve with:
[ERROR] Missing requirement: org.eclipse.jetty.util 10.0.0 requires 'java.package; com.sun.nio.file 0.0.0' but it could not be found
[ERROR] Cannot satisfy dependency: org.eclipse.help.feature.group 2.3.500.qualifier depends on: org.eclipse.equinox.p2.iu; org.eclipse.jetty.util 0.0.0
Import-Package: com.sun.nio.file,javax.imageio,javax.naming.ldap,javax.n
et.ssl,javax.security.auth.x500,javax.xml.parsers,org.eclipse.jetty.uti
l,org.eclipse.jetty.util.annotation,org.eclipse.jetty.util.component,or
g.eclipse.jetty.util.resource,org.eclipse.jetty.util.security,org.eclip
se.jetty.util.statistic,org.eclipse.jetty.util.thread,org.slf4j;version
="[2.0.0,3)"
the com.sun.nio.file import-package looks needless in fully modularized system.
The text was updated successfully, but these errors were encountered: