-
Notifications
You must be signed in to change notification settings - Fork 201
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
Cannot use Fastutil 8.5.4 in modular application #245
Comments
Sigh. Why was I sure that was gonna happen? Apparently, I did everything in the right way, using Require-Bundle to split packages across bundles. I'm now finding notes in stackexchange and other places about the fact that bnd does not support Require-Bundle. I'm still investigating—if you can help with this, or you know someone who can help, that'd be great. |
Sadly I don't know how. Is it even necessary to have the package in all jars? if its an internal helper maybe move it into a separate package or another libary? |
I'm having the same issue. I agree with @iTitus, my best guess is also that the three new jars share common packages. Another related issue that I found is that Fastutil 8.5.4 fails when you include other dependencies that also depend on Fastutil (i.e. Tablesaw) and you manage the dependency convergence (i.e. Maven Enforcer Plugin). I think the reason here is not only that jars share common packages, but also that A possible solution for the second issue could be to rename |
I've read in a Manning book that probably the correct thing to do would be to have a façade fastutil.jar with dependency on the other three jars. On the other hand I'm a bit confused because elsewhere they say that you cannot import a package split between jars—you have to require the bundle, rather than import a package. What if you do a Require-Bundle it.unimi.dsi.fastutil instead of an import? |
A possibility is to do a complete rollback and put back the jars together. Then when we move to Java 9 I've read you can split packages. But it would be nice to have a clean OSGi solution. I've asked on StackOverflow for suggestions without success. |
Uhh, just to make sure everyone is on the same page - I think this issue was raised about JPMS modules, not OSGI bundles. Or maybe I'm missing something. It might be the case that there's a problem with OSGI too, but the error message above definitely reads like a JPMS (Jigsaw) issue. |
OSGi is not the concern here. We should rather care about the module system, as modern JVMs depend on it |
I think this is probably true as the new release does not work with JGraphT, which uses JPMS but not OSGi. Up to now the JPMS infrastructure was happy with the OSGi data. Maybe I should leave the JAR separation for a Java 9-only release. |
Commit c8050c0 changes the way I distributed fastutil. There will be a traditional fastutil.jar, and a fastutil-core.jar with the basic classes. They have overlapping classes and no dependency between them. If you happen to have both on your classpath, you should exclude fastutil-core.jar. Please let me know if this works for you. |
Will you create a new build on Maven or shall I try to self-build? |
If you can try, that would be great a a test. However, since your are using the full jar I expect everything to work. It's the core package that should be tested instead... |
Thanks for the changing the way fastutil is distributed. I tested the full jar and as you said it worked. Haven't test core though. |
Ok, thanks. Other people are testing the core jar and then I'll distribute 8.5.5. |
Cannot use Fastutil 8.5.4 in modular application.
Errors:
I think the problem is that different modules cannot provide the same package.
The text was updated successfully, but these errors were encountered: