Cześć, od kilku dni męczę się, żeby skonfigurować sobie LIBGDX w taki sposób, żeby łączył się również z bazą Oraclową za pomocą Hibernate.
Po odpaleniu projektu wygenerowanego przez LIBGDX w gradlu, próbuję podpiąć Hibernate. W tym celu dodaję biblioteki Hibernate oraz JDBC do projektu (), tworzę plik persistence.xml (
) i tworzę EntityManagera w klasie main.
package Gradletest;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
public class test {
public static void main(String[] args) {
System.out.println("test");
EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("RPGPersistence");
EntityManager EntityManager = entityManagerFactory.createEntityManager();
}
}
W pliku build.gradle dodaję wpis implementujący hibernate.
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
}
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:27.0.1-jre'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
implementation 'org.hibernate:hibernate-core:5.2.17.Final'
}
Kiedy próbuję odpalić program, dostaję błąd, którym od kilku dni nie mogę sobie poradzić. Brzmi on tak:
** Error occurred during initialization of boot layer
java.lang.module.FindException: Unable to derive module descriptor for F:\Soft\hibernate-release-5.2.17.Final\lib\required\jboss-transaction-api_1.2_spec-1.0.1.Final.jar
Caused by: java.lang.IllegalArgumentException: jboss.transaction.api.1.2.spec: Invalid module name: '1' is not a Java identifier **
Ktoś może wie jak go rozwiązać?
- screenshot-20190910112716.png (173 KB) - ściągnięć: 116
- screenshot-20190910112548.png (195 KB) - ściągnięć: 109
- screenshot-20190910112619.png (195 KB) - ściągnięć: 71