Skip to content
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

Difference between jaxb-runtime(glassfish) and jaxb-ri(com.sun) and JPMS #1813

Open
xmourgues opened this issue Sep 24, 2024 · 0 comments
Open

Comments

@xmourgues
Copy link

Hello,

I'm having an issue with this different package :
org.glassfish.jaxb:jaxb-xjc:4.0.4
com.sun.xml.bind:jaxb-xjc:4.0.4

The issue is the following.
I'm using org.eclipse.persistence.moxy which need jaxb-xjc.

If I set up my dependency (and module-info.java just to force loading the xjc module) to use the glassfish implementation. I have the following errors

Module org.eclipse.persistence.moxy does not read a module that exports com.sun.tools.xjc

When I use the com.sun implementation, there is no problem.

I want to use the glassfish because my module which use moxy will be required by a bigger project that already have the glassfish implementation and I can not switch it.

When debugging JPMS module resolution, this doesn't give more information except the module name changing
(extract with glassfish):

root com.example.moxy.moxy.xjc.example file:///home/xmourgues/projects/prj-collection/workspace/moxy-xjc-example/target/classes/
com.example.moxy.moxy.xjc.example requires org.eclipse.persistence.moxy file:///home/xmourgues/.m2/repository/org/eclipse/persistence/org.eclipse.persistence.moxy/4.0.4/org.eclipse.persistence.moxy-4.0.4.jar
com.example.moxy.moxy.xjc.example requires org.glassfish.jaxb.xjc file:///home/xmourgues/.m2/repository/org/glassfish/jaxb/jaxb-xjc/4.0.4/jaxb-xjc-4.0.4.jar
...
org.glassfish.jaxb.xjc binds org.eclipse.persistence.moxy file:///home/xmourgues/.m2/repository/org/eclipse/persistence/org.eclipse.persistence.moxy/4.0.4/org.eclipse.persistence.moxy-4.0.4.jar
...
java.lang.module.ResolutionException: Module org.eclipse.persistence.moxy does not read a module that exports com.sun.tools.xjc

(same extract with com.sun):

root com.example.moxy.moxy.xjc.example file:///home/xmourgues/projects/prj-collection/workspace/moxy-xjc-example/target/classes/
com.example.moxy.moxy.xjc.example requires com.sun.tools.xjc file:///home/xmourgues/.m2/repository/com/sun/xml/bind/jaxb-xjc/4.0.4/jaxb-xjc-4.0.4.jar
com.example.moxy.moxy.xjc.example requires org.eclipse.persistence.moxy file:///home/xmourgues/.m2/repository/org/eclipse/persistence/org.eclipse.persistence.moxy/4.0.4/org.eclipse.persistence.moxy-4.0.4.jar
...
com.sun.tools.xjc binds org.eclipse.persistence.moxy file:///home/xmourgues/.m2/repository/org/eclipse/persistence/org.eclipse.persistence.moxy/4.0.4/org.eclipse.persistence.moxy-4.0.4.jar

I tried adding --add-reads org.eclipse.persistence.moxy=org.glassfish.jaxb.xjc but it doesnt fix the issue

Here is a repository with a minimal test to reproduce : https://github.com/xmourgues/moxy-xjc-example
All you have to do is switch dependency in the pom.xml and change the requires in the module-info.java

Any help is welcomed

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant