I have a Hibernate 5 project that perfectly builds and runs on Java 8. I tried to test it on JDK 9 ea build 171.
Since it is a huge project and have other dependencies I had to add java.xml.bind
module to the JVM configuration for tests:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<configuration>
<argLine>--add-modules java.xml.bind</argLine>
</configuration>
</plugin>
There were other issues that I could resolve but if used aggregated module java.se.ee(as recommended):
<argLine>--add-modules java.se.ee</argLine>
I got an exception :
java.lang.NoClassDefFoundError: javax/transaction/SystemException
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:374)
at org.jboss.logging.Logger$1.run(Logger.java:2554)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.jboss.logging.Logger.getMessageLogger(Logger.java:2529)
I couldn't even understand why it happened because JTA library(with SystemException
class) is in the class-path when tests were running.
Any suggestions on how to fix this?