-
Notifications
You must be signed in to change notification settings - Fork 75
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
Duplicate package export: jnr.enxio.channels #58
Comments
jnr-unixsocket exports package "jnr.enxio.channels" from multiple packages. See issue jnr/jnr-unixsocket#58 The workaround uses DynamicImport-Package to cowboy-resolve classes at runtime. Slower and a bit rough but an easy fix.
Also happens for Java 9:
Looking forward to see this fixed. |
This definitely needs to be fixed. I don't think there's any reason it needs to use the enxio package. |
Ok, part of the problem is that it used this package to gain access to the package-private |
In its MANIFST.MF,
jnr-unixsocket
exports packagejnr.enxio.channels
. However, the same package is exported by its dependency bundlejnr-enxio.
This results in ClassNotFoundExceptions in OSGi environments because the class loader will bind exclusively to one bundle and thus fail to load classes from the other bundle. See section 3.6.6 in the OSGi spec [1], for instance.
A clean fix would be splitting the classes in
jnr-unixsocket -> jnr.enxio.channels
andjnr-enxio -> jnr.enxio.channels
into two different packages, e.g.jnr.enxio.channels.api
andjnr.enxio.channels.impl
.A workaround without modifying package names could be to use
Require-Bundle: jnr-enxio
in MANIFEST.MF ofjnr-unixsocket
.[1] https://osgi.org/specification/osgi.core/7.0.0/framework.module.html
The text was updated successfully, but these errors were encountered: