Hibernate ORM Generation in a Java 9 Application

I am trying to create an ORM using sleep mode I am using the oracle 11g database and I get this error after creating a sleep generation configuration

java.lang.reflect.InaccessibleObjectException: Unable to make field java.util.ArrayList jdk.internal.loader.URLClassPath.loaders accessible: module java.base does not "opens jdk.internal.loader" to unnamed module @6a75c1c8
Unable to make field java.util.ArrayList jdk.internal.loader.URLClassPath.loaders accessible: module java.base does not "opens jdk.internal.loader" to unnamed module @6a75c1c8
java.lang.reflect.InaccessibleObjectException: Unable to make field java.util.ArrayList jdk.internal.loader.URLClassPath.loaders accessible: module java.base does not "opens jdk.internal.loader" to unnamed module @6a75c1c8
Unable to make field java.util.ArrayList jdk.internal.loader.URLClassPath.loaders accessible: module java.base does not "opens jdk.internal.loader" to unnamed module @6a75c1c8

and this is my Hibernate.cfg.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="hibernate.connection.password">compte</property>
        <property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:orcl</property>
        <property name="hibernate.connection.username">compte</property>
        <property name="hibernate.default_schema">COMPTE</property>
        <property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
    </session-factory>
</hibernate-configuration>
+4
source share
1 answer

The exception seems justified if there is a type in your class path that is trying to access jdk.internal.loader.URLClassPaththat is used as an inner class in the JDK and exported specifically to java.desktop, java.instrumentand java.loggingmore.

A little more about an unnamed module : -

. , , , , .

( ) - VM args::

--add-opens java.base/jdk.internal.loader=ALL-UNNAMED

, jdk.internal.loader java.base .

/ , , .

+1

Source: https://habr.com/ru/post/1691454/


All Articles