При использовании аддона Dynamic Attribute возникает такая ошибка при запуске, если подключен дополнительный источник данных.
Если не создавать в классах поле с ссылкой на класс Category из аддона Dynamic Attribute, то проект запускается.
Если убрать источник данных и создать в классе поле с ссылкой на класс Category, то тоже проект запускается.
Если скомпилировать в jar файл и запустить из консоли, то даже с дополнительным источником данных и полем с ссылкой на класс Category приложение запустится.
2023-11-10 09:28:10.955 WARN 12596 — [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sql04EntityManagerFactory’ defined in class path resource [com/company/testdynamicattribute/Sql04StoreConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.7.9.6-jmix): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [sql04] failed.
Internal Exception: Exception [EclipseLink-7250] (Eclipse Persistence Services - 2.7.9.6-jmix): org.eclipse.persistence.exceptions.ValidationException
Exception Description: [class com.company.testdynamicattribute.entity.Car] uses a non-entity [class io.jmix.dynattr.model.Category] as target entity in the relationship attribute [field category].
2023-11-10 09:28:10.956 INFO 12596 — [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated…
2023-11-10 09:28:10.964 INFO 12596 — [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2023-11-10 09:28:10.965 INFO 12596 — [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Shutdown initiated…
2023-11-10 09:28:10.969 INFO 12596 — [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Shutdown completed.
2023-11-10 09:28:10.974 INFO 12596 — [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2023-11-10 09:28:10.989 INFO 12596 — [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2023-11-10 09:28:11.018 ERROR 12596 — [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sql04EntityManagerFactory’ defined in class path resource [com/company/testdynamicattribute/Sql04StoreConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.7.9.6-jmix): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [sql04] failed.
Internal Exception: Exception [EclipseLink-7250] (Eclipse Persistence Services - 2.7.9.6-jmix): org.eclipse.persistence.exceptions.ValidationException
Exception Description: [class com.company.testdynamicattribute.entity.Car] uses a non-entity [class io.jmix.dynattr.model.Category] as target entity in the relationship attribute [field category].
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.24.jar:5.3.24]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-2.7.6.jar:2.7.6]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-2.7.6.jar:2.7.6]
at com.company.testdynamicattribute.TestDynamicAttributeApplication.main(TestDynamicAttributeApplication.java:25) ~[main/:na]
Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 2.7.9.6-jmix): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Predeployment of PersistenceUnit [sql04] failed.
Internal Exception: Exception [EclipseLink-7250] (Eclipse Persistence Services - 2.7.9.6-jmix): org.eclipse.persistence.exceptions.ValidationException
Exception Description: [class com.company.testdynamicattribute.entity.Car] uses a non-entity [class io.jmix.dynattr.model.Category] as target entity in the relationship attribute [field category].
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createPredeployFailedPersistenceException(EntityManagerSetupImpl.java:2112) ~[org.eclipse.persistence.jpa-2.7.9-6-jmix.jar:na]
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2088) ~[org.eclipse.persistence.jpa-2.7.9-6-jmix.jar:na]
at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactoryImpl(PersistenceProvider.java:350) ~[org.eclipse.persistence.jpa-2.7.9-6-jmix.jar:na]
at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:316) ~[org.eclipse.persistence.jpa-2.7.9-6-jmix.jar:na]
at io.jmix.eclipselink.impl.JmixPersistenceProvider.createContainerEntityManagerFactory(JmixPersistenceProvider.java:36) ~[jmix-eclipselink-1.4.2.jar:na]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.24.jar:5.3.24]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.24.jar:5.3.24]
… 16 common frames omitted
Caused by: org.eclipse.persistence.exceptions.EntityManagerSetupException:
Exception Description: Predeployment of PersistenceUnit [sql04] failed.
Internal Exception: Exception [EclipseLink-7250] (Eclipse Persistence Services - 2.7.9.6-jmix): org.eclipse.persistence.exceptions.ValidationException
Exception Description: [class com.company.testdynamicattribute.entity.Car] uses a non-entity [class io.jmix.dynattr.model.Category] as target entity in the relationship attribute [field category].
at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:233) ~[org.eclipse.persistence.core-2.7.9-6-jmix.jar:na]
… 27 common frames omitted
Caused by: org.eclipse.persistence.exceptions.ValidationException:
Exception Description: [class com.company.testdynamicattribute.entity.Car] uses a non-entity [class io.jmix.dynattr.model.Category] as target entity in the relationship attribute [field category].
at org.eclipse.persistence.exceptions.ValidationException.nonEntityTargetInRelationship(ValidationException.java:1383) ~[org.eclipse.persistence.core-2.7.9-6-jmix.jar:na]
at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor.getReferenceDescriptor(RelationshipAccessor.java:569) ~[org.eclipse.persistence.jpa-2.7.9-6-jmix.jar:na]
at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.ObjectAccessor.processForeignKeyRelationship(ObjectAccessor.java:678) ~[org.eclipse.persistence.jpa-2.7.9-6-jmix.jar:na]
at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.ObjectAccessor.processOwningMappingKeys(ObjectAccessor.java:752) ~[org.eclipse.persistence.jpa-2.7.9-6-jmix.jar:na]
at org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.ManyToOneAccessor.process(ManyToOneAccessor.java:130) ~[org.eclipse.persistence.jpa-2.7.9-6-jmix.jar:na]
at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processOwningRelationshipAccessors(MetadataProject.java:1666) ~[org.eclipse.persistence.jpa-2.7.9-6-jmix.jar:na]
at org.eclipse.persistence.internal.jpa.metadata.MetadataProject.processStage3(MetadataProject.java:1919) ~[org.eclipse.persistence.jpa-2.7.9-6-jmix.jar:na]
at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processORMMetadata(MetadataProcessor.java:584) ~[org.eclipse.persistence.jpa-2.7.9-6-jmix.jar:na]
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:629) ~[org.eclipse.persistence.jpa-2.7.9-6-jmix.jar:na]
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2009) ~[org.eclipse.persistence.jpa-2.7.9-6-jmix.jar:na]
… 25 common frames omitted
Task :bootRun FAILED