-
Notifications
You must be signed in to change notification settings - Fork 383
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
Packages accessible from more than one module due to GWT SDK from Eclipse plugin #10051
Comments
Can you clarify when/how you get those errors? Is it from the eclipse plugin, or from running the gradle build, and if so, can you share logs and the full stack trace? There is no GWT 2.11.2, can you clarify which version you are using? |
Sorry, I type wrong, GWT 2.12.1 THe, error, is it from Eclipse directly. It saying I have a compile error: In my import javax.xml.parsers.*; The package javax.xml.parsers is accessible from more than one module: , java.xml No error on my builds command from the gradle build. Like I said, it comes the "" module comes from the gwt-dev.jar that includes the package as well which generates the conflict. Again sorry, to say it again, If I remove those close from the gwt-dev.jar (included in the Eclipse GWT Plugin) Everything is working fine but I don't like to trick the tool by removing classes :/ |
This looks like server code, and those packages are only shaded into I believe this is doubly important if you support jpms modules in your server , as you've discovered, since gwt-dev.jar at this time doesn't respect those boundaries, but instead tries to ship a complete classpath. Using the unnamed module may resolve this - but I strongly urge you to remove gwt-user and gwt-dev from your server classpath. I can only find |
Client and server code should not be on the same classpath, the same source directories, the same project. Client dependencies apply to client projects, and server dependencies to server projects. There are a number of good reasons to do this, and this has been the suggestion for new projects (though the GWT Plugin for Eclipse has come under new management, and this part hasnt been updated yet I believe. Using JPMS is an optional feature for Java projects, and results in the error you are seeing, but only if classpaths are mixed in this way. If you want to use Java modules, you will need to have a modularized project, or apply specific javac/java args to manage exports/opens/etc to allow this. Regardless of how you decide to manage this, please ensure that neither gwt-dev nor gwt-user are in your deployed server classpath. Your last screenshot seems to show that you are using maven, as well as the GWT sdk (but not from maven). I suggest picking one and using it, rather than letting your CI, prod, cli builds use maven, and your IDE builds use eclipse. |
At this point, I think you should consider moving this to https://github.com/gwt-plugins/gwt-eclipse-plugin/ - there might be a setup issue, or a bug with the plugin. But removing GWT from the server project should not prevent the client project from still having GWT enabled, using the version of your choice, and compiling from the plugin. |
Ok, I start to get it now, yes I think i'll move over there. I saw: gwt-plugins/gwt-eclipse-plugin#414 which might be related or very close to my issue BUT I don't see how to fix that. I'll recreate there and close this one |
gwt-plugins/gwt-eclipse-plugin#504 - follow up FYI |
**GWT version: 2.12.1
**Browser (with version): N/A
Operating System: MACOS
Description
I have an error on some package since I try to move from java 8 to java 17.
In fact, i compile good through my gradle commands (so I build correctly the project)... But i still have many errors on Eclipse.
I have some errors like:
The package javax.xml.parsers is accessible from more than one module: , java.xml
The main Reason of that this is because on gwt-dev.jar that is included in the GWT SDK from the eclipse plugin. It contains it.
Of course the GWT SDK is in the classpath for the project... and then, I have this error... (as it goes through a conflict)
I am pretty sure somebody ran into this at some point, but i didn't have any clues at the moment.
The easiest solution would be to trick my "gwt-dev.jar" to remove the unnecessary classes but that's not a suitable way to do in the long run...
(like doing:
zip -d gwt-dev.jar "org/w3c/" "org/xml/" "javax/xml/" "netscape/javascript/"
)
If it is possible to exclude during runTime the "xerces" group from the gwt-dev.jar, that would be great, but as it is inside the "SDK" I cannot manipulate as I would like to. (it is not installed through a "normal" Gradle implmentation).
I have some gradle command to "install the SDK" automatically through gradle task (I use "org.wisepersist.gwt" version "1.1.19"):
Happy to know if someone has any idea :)
The text was updated successfully, but these errors were encountered: