-
Notifications
You must be signed in to change notification settings - Fork 34
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
ClassNotFoundException: javax.xml.bind.DatatypeConverter when using jdk9 #127
Comments
Which signatures file is causing this? |
Here's what I have in the parent pom:
|
Can I have a stack the and full Maven log output? Forbidden-apis works fine with current Java 9 and there is no signature file having any xml.bind classes. I know that some projects forbid base64 encoder from the jaxb classes, but that's not the case with this pom file. |
Can I send that file to the mail address that is on top of your thetaphi homepage? The file contains numerous personal details about my installation that I don't want to be public. I tried obscuring it but there's just too much. |
The xmpbox subproject itself needs "--add-modules java.xml.bind" to run its tests. It's just that for some reason, your tool needs it too and my setting influences only the tests. |
Yes you can do this. IMHO, the problem is not in forbiddenapis. To be sure I need a log file with stack trace enabled. There is one thing where this may happen: If one of your dependencies or your code is using the xml.bind classes, but at the time of scanning forbidden apis they are not visible, you may have the problem. Are you sure, your own code is not using those classes? FYI, this is unrelated to #118 |
Yes my own code is using these classes. |
Sorry, wrong button. I have seen you already posted. The problem seems the xmpbox subproject: It uses the classes from the xml.bind module (JAXB) in its tests. When forbiddenapis scans the classes for violations, it also needs to see those xml.bind classes, as the code depends on it. As forbiddenapis runs in-process with Maven, there is no other way than also adding the module to Maven itsself. IMHO, you should fix your subproject to not use JAXB or ideally add the JAXB classes as dependency. With Java 9, JAXB is by default no longer enabled, so the best is to just depend on JAXB directly. |
Hi Tilman,
There is currently nothing that forbiddenapis can do, but you can do one of the following:
I'll close the issue. |
I have read #118 but I'm not sure if this is related. I get this when building with jdk9:
[ERROR] Failed to execute goal de.thetaphi:forbiddenapis:2.3:check (default) on project xmpbox: Check for forbidden API calls failed: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter -> [Help 1]
I was able to get it running by doing this (windows cmd) before calling maven
set MAVEN_OPTS=--add-modules java.xml.bind
so now it's probably just a documentation improvement suggestion.
Maybe it could also work by using the exec-maven-plugin, I didn't test.
The text was updated successfully, but these errors were encountered: