Open martinjoconnor opened 3 years ago
Note that this is an issue with the maven-jaxb2-plugin (latest version 0.14.0, https://mvnrepository.com/artifact/org.jvnet.jaxb2.maven2/maven-jaxb2-plugin), which is used only by the submission server - not the Mojo jaxb2-maven-plugin (https://www.mojohaus.org/jaxb2-maven-plugin/Documentation/v2.2/), which is used elsewhere in CEDAR.
What is the solution for this? I got the same error when compiling with Java 11
The error message is gone now-- all good!
I'm not having issues with Java 11. Are you getting exactly that error or maybe this one (related to jaxb2-maven-plugin) https://github.com/mojohaus/jaxb2-maven-plugin/issues/115? Our workaround is explained at https://github.com/metadatacenter/cedar-project/issues/1015 and https://github.com/metadatacenter/cedar-mkdocs-developer/blob/develop/site/index.html (in short, you just have to just run createjaxb2workaround
)
I've executed createjaxb2workaround
but the error still persists. In addition, I got this error message as well:
...
Caused by: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String,[B,int,int,java.lang.ClassLoader,java.security.ProtectionDomain)
at java.base/java.lang.Class.getMethod(Class.java:2227)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector$3.run(Injector.java:201)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector$3.run(Injector.java:197)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
... 140 more
After browsing around, I found this workaround and I can compile the submission server. Basically you added <dependencies>
to maven-jaxb-plugin in the submission-server-core's POM.
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.14.0</version>
<dependencies>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.3</version>
</dependency>
</dependencies>
<executions>
...
This also fixes the same error for the impex server
It would be good to know if this fix has any effects on the model transformations done by the submissions and impex servers. It's good that the projects compile, but if we want consider merging this to develop we have to be sure that there are no side effects
Let me make a pull request so you can test it and do the merge when you see it fits
Works with Java version 15. Following error with Java 16.0.1: