In my pom.xml file I have only one dependency:
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.12.Final</version>
</dependency>
</dependencies>
and also a module-info.java
module testmodule {
requires hibernate.jpa;
requires hibernate.core;
}
but when I'm trying to run my app I get the error: Caused by: java.lang.IllegalArgumentException: jboss.transaction.api.1.2.spec: Invalid module name: '1' is not a Java identifier. Any thoughts how to deal with it?
From the stacktrace, the exception is not for the hibernate-core module but for the
jboss-transaction-api_1.2_spec
dependency included in your project.
Until the version 1.0.1.Final
of the dependency, the automatic module name could not be derived from the jar file name.
This has been though updated in their 2.0.0.Alpha1 release from October 2017 which now has a module-info.class
packaged in the jar to get the module name from.
So, you can preferably use 2.0.0.Alpha1
version with module name java.transaction
as:
<dependency>
<groupId>org.jboss.spec.javax.transaction</groupId>
<artifactId>jboss-transaction-api_1.2_spec</artifactId>
<version>2.0.0.Alpha1</version>
</dependency>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With