Невозможно сделать доступным последний байт поля java.lang.String.coder [закрыто]JAVA

Программисты JAVA общаются здесь
Ответить Пред. темаСлед. тема
Anonymous
 Невозможно сделать доступным последний байт поля java.lang.String.coder [закрыто]

Сообщение Anonymous »

Я пытаюсь добавить базу данных в памяти H2 в свой проект и получаю эту ошибку при инициализации моего приложения при добавлении @Entity в мою модель домена.
Текущие версии:< /p>
  • Maven: 3.9.4
  • Java: 21.0.3
  • H2 : 2.3.232
  • maven-compiler-plugin: 3.11.0
Свойства приложения:

Код: Выделить всё

spring.datasource.url=jdbc:h2:mem:some
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.datasource.generate-unique-name=false
spring.datasource.name=some-db
spring.jpa.defer-datasource-initialization=true
spring.jpa.hibernate.ddl-auto=create
Зависимости:

Код: Выделить всё

   
org.springframework.boot
spring-boot-starter-data-jpa
3.3.4



com.h2database
h2
runtime
2.3.232

Исключение:

Невозможно сделать приватным последний байт поля java.lang.String.coder
доступным : модуль java.base не «открывает java.lang» для безымянного
модуля

Полная ошибка:

Код: Выделить всё

2024-09-30 14:16:31 ERROR - Failed to initialize JPA EntityManagerFactory: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is java.lang.IllegalStateException: PostInitCallback queue could not be processed...
- PostInitCallbackEntry - EmbeddableMappingType(com.xxx.ExecutedCommand.commandParameters.parameters#{element})#finishInitialization
- PostInitCallbackEntry - EmbeddableMappingType(com.xxx.ExecutedCommand.response.data#{element})#finishInitialization

2024-09-30 14:16:31 WARN - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is java.lang.IllegalStateException: PostInitCallback queue could not be processed...
- PostInitCallbackEntry - EmbeddableMappingType(com.xxx.ExecutedCommand.commandParameters.parameters#{element})#finishInitialization
- PostInitCallbackEntry - EmbeddableMappingType(com.xxx.ExecutedCommand.response.data#{element})#finishInitialization

2024-09-30 14:16:31 INFO - some-db - Shutdown initiated...
2024-09-30 14:16:31 INFO - some-db - Shutdown completed.

Error starting ApplicationContext.  To display the condition evaluation report re-run your application with 'debug' enabled.
2024-09-30 14:16:31 ERROR- Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is java.lang.IllegalStateException: PostInitCallback queue could not be processed...
- PostInitCallbackEntry - EmbeddableMappingType(com.xxx.ExecutedCommand.commandParameters.parameters#{element})#finishInitialization
- PostInitCallbackEntry - EmbeddableMappingType(com.xxx.ExecutedCommand.response.data#{element})#finishInitialization

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1806) ~[spring-beans-6.1.13.jar:6.1.13]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) ~[spring-beans-6.1.13.jar:6.1.13]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-6.1.13.jar:6.1.13]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337) ~[spring-beans-6.1.13.jar:6.1.13]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.13.jar:6.1.13]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335) ~[spring-beans-6.1.13.jar:6.1.13]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:205) ~[spring-beans-6.1.13.jar:6.1.13]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:954) ~[spring-context-6.1.13.jar:6.1.13]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:625) ~[spring-context-6.1.13.jar:6.1.13]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.3.3.jar:3.3.3]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) [spring-boot-3.3.3.jar:3.3.3]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) [spring-boot-3.3.3.jar:3.3.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) [spring-boot-3.3.3.jar:3.3.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1363) [spring-boot-3.3.3.jar:3.3.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1352) [spring-boot-3.3.3.jar:3.3.3]
at com.xxx.Application.main(Application.java:14) [classes/:?]
Caused by: jakarta.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is java.lang.IllegalStateException: PostInitCallback queue could not be processed...
- PostInitCallbackEntry - EmbeddableMappingType(com.xxx.ExecutedCommand.commandParameters.parameters#{element})#finishInitialization
- PostInitCallbackEntry - EmbeddableMappingType(com.xxx.ExecutedCommand.response.data#{element})#finishInitialization

at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:421) ~[spring-orm-6.1.13.jar:6.1.13]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-6.1.13.jar:6.1.13]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:366) ~[spring-orm-6.1.13.jar:6.1.13]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853) ~[spring-beans-6.1.13.jar:6.1.13]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1802) ~[spring-beans-6.1.13.jar:6.1.13]

Suppressed: java.lang.reflect.InaccessibleObjectException: Unable to make field private final byte java.lang.String.coder accessible: module java.base does not "opens java.lang"  to unnamed module @3c72f59f
Пробывал возможные решения, но получил ту же ошибку: Также попробовал обновить версию maven до 3.9. 9, но получаю ту же ошибку.
Есть предложения по устранению этой ошибки?

Подробнее здесь: https://stackoverflow.com/questions/790 ... accessible
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение
  • Невозможно сделать доступным последний байт поля java.lang.String.coder.
    Anonymous » » в форуме JAVA
    0 Ответы
    9 Просмотры
    Последнее сообщение Anonymous
  • Ошибка: put(java.lang.string, list) в хэш-карте нельзя применить к (java.util.list)
    Гость » » в форуме JAVA
    0 Ответы
    253 Просмотры
    Последнее сообщение Гость
  • Ошибка: put(java.lang.string, list) в хэш-карте нельзя применить к (java.util.list)
    Гость » » в форуме Android
    0 Ответы
    232 Просмотры
    Последнее сообщение Гость
  • Невозможно сделать поле частным окончательным java.lang.String java.io.File.path доступным Qt Android
    Гость » » в форуме JAVA
    0 Ответы
    72 Просмотры
    Последнее сообщение Гость
  • Невозможно сделать поле частным окончательным java.lang.String java.io.File.path доступным Qt Android
    Гость » » в форуме Android
    0 Ответы
    57 Просмотры
    Последнее сообщение Гость

Вернуться в «JAVA»