Ich möchte nur eine einfache Datenbankverbindung mit Hibernate ausführen, aber es hat nicht funktioniert.
Verwende das Hibernate-Tool zum ersten Mal und habe die hibernate.cfg.xml unter src abgelegt /main/resources.
Wenn ich diese Java-Anwendung ausführe, enthält Folgendes:
SessionFactory factory = new Configuration().configure("hibernate.cfg.xml").addAnnotatedClass(Users.class).buildSessionFactory();
Es stürzt mit mehreren Ausnahmen ab:
Dec 23, 2024 6:58:20 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate ORM core version 5.6.15.Final
Exception in thread "main" org.hibernate.internal.util.config.ConfigurationException: Unable to perform unmarshalling at line number 0 and column 0 in RESOURCE hibernate.cfg.xml. Message: null
...
Caused by: javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.
- with linked exception:
[java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory]
...
Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory
hibernate.cfg.xml:
com.mysql.jdbc.Driver
org.hibernate.dialect.MySQLDialect
jdbc:mysql://localhost:3306/rsryanl
root
Password#00
true
thread
ConfigurationException: Unmarshalling kann bei Zeilennummer 0 und Spalte 0 in RESOURCE hibernate.cfg.xml nicht durchgefü ⇐ Java
-
- Similar Topics
- Replies
- Views
- Last post