pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedspring context cannot load when I use postgres 42.2.15 or higher
3+ messages / 3 participants
[nested] [flat]
* spring context cannot load when I use postgres 42.2.15 or higher
@ 2020-10-29 14:04 Hetty Kronemeijer <h.kronemeijer@humaninference.com>
0 siblings, 1 reply; 3+ messages in thread
From: Hetty Kronemeijer @ 2020-10-29 14:04 UTC (permalink / raw)
To: pgsql-jdbc@lists.postgresql.org <pgsql-jdbc@lists.postgresql.org>
Hi there,
My spring application was using postgres driver version 42.2.16.
Recently I added jpa using spring-boot-data-jpa version 2.3.1.RELEASE, and spring version 5.2.7.RELEASE.
Loading the spring context results in and error now. This happens with all versions of postgres from 42.2.15.
I’m currently using 42.2.14 and that works fine.
What has changed in version 42.2.15 that causes the problem and how can I upgrade?
Thanks in advance,
Hetty Kronemeijer
Here’s the stack trace:
2020-10-29 13:06:12,852 [main] ERROR Server, com.hi.identify.multitenant.server.main.Server:101 - [] Error during application startup
com.hi.identify.multitenant.exception.MultitenantIdentifyException: Unexpected error occurred: Error creating bean with name 'entityManagerFactory' defined in com.hi.identify.multitenant.tenant.config.TenantSpringConfig: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Required class information is missing
at com.hi.identify.multitenant.server.main.Server.handleExceptionDuringStart(Server.java:93)
at com.hi.identify.multitenant.server.main.Server.main(Server.java:78)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in com.hi.identify.multitenant.tenant.config.TenantSpringConfig: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Required class information is missing
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)
at com.hi.identify.multitenant.server.context.ServerFactory.loadSpringContext(ServerFactory.java:55)
at com.hi.identify.multitenant.server.context.ServerFactory.create(ServerFactory.java:28)
at com.hi.identify.multitenant.server.main.Server.main(Server.java:76)
Caused by: java.lang.IllegalStateException: Required class information is missing
at org.jboss.jandex.Indexer.rebuildNestedType(Indexer.java:926)
at org.jboss.jandex.Indexer.resolveTypePath(Indexer.java:786)
at org.jboss.jandex.Indexer.resolveTypeAnnotation(Indexer.java:705)
at org.jboss.jandex.Indexer.resolveTypeAnnotations(Indexer.java:613)
at org.jboss.jandex.Indexer.index(Indexer.java:1602)
at org.hibernate.boot.archive.scan.spi.ClassFileArchiveEntryHandler.toClassDescriptor(ClassFileArchiveEntryHandler.java:64)
at org.hibernate.boot.archive.scan.spi.ClassFileArchiveEntryHandler.handleEntry(ClassFileArchiveEntryHandler.java:52)
at org.hibernate.boot.archive.internal.JarFileBasedArchiveDescriptor.visitArchive(JarFileBasedArchiveDescriptor.java:147)
at org.hibernate.boot.archive.scan.spi.AbstractScannerImpl.scan(AbstractScannerImpl.java:48)
at org.hibernate.boot.model.process.internal.ScanningCoordinator.coordinateScan(ScanningCoordinator.java:76)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.prepare(MetadataBuildingProcess.java:98)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:254)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:168)
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:52)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:391)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:378)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792)
... 14 common frames omitted
Verzonden vanuit Mail<https://go.microsoft.com/fwlink/?LinkId=550986; voor Windows 10
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: spring context cannot load when I use postgres 42.2.15 or higher
@ 2020-10-29 15:41 Jonathan Strauss <rapidtransit@fastmail.com>
parent: Hetty Kronemeijer <h.kronemeijer@humaninference.com>
0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Strauss @ 2020-10-29 15:41 UTC (permalink / raw)
To: pgsql-jdbc@lists.postgresql.org
I can't comment on the Driver but it looks the error is coming from Jandex from some nested class?
https://github.com/wildfly/jandex/blob/7f2c075ba9246e4b6cc8fe7f3e3678dc2b64891c/src/main/java/org/jb...
, if you are using Spring Boot you should utilize the Boot ecosystem, do not just add specific version dependencies willy nilly unless you know what you are doing. You should rely on the Spring Boot BOM which makes sure all the correct versions are used and if you need to override a version you can do it via a Maven or Gradle property instead of playing who's got the button (or should I say whos go the transitive dependency?) and need to exclude (Of course if you are using Gradle you can force exclude all on specific stuff but that's more the nuclear option) and then re-add the version you need in your build.
On Thu, Oct 29, 2020, at 10:04 AM, Hetty Kronemeijer wrote:
> Hi there,
>
> My spring application was using postgres driver version 42.2.16.
> Recently I added jpa using spring-boot-data-jpa version 2.3.1.RELEASE, and spring version 5.2.7.RELEASE.
> Loading the spring context results in and error now. This happens with all versions of postgres from 42.2.15.
> I’m currently using 42.2.14 and that works fine.
> What has changed in version 42.2.15 that causes the problem and how can I upgrade?
>
> Thanks in advance,
> Hetty Kronemeijer
>
>
> Here’s the stack trace:
>
> 2020-10-29 13:06:12,852 [main] ERROR Server, com.hi.identify.multitenant.server.main.Server:101 - [] Error during application startup
> com.hi.identify.multitenant.exception.MultitenantIdentifyException: Unexpected error occurred: Error creating bean with name 'entityManagerFactory' defined in com.hi.identify.multitenant.tenant.config.TenantSpringConfig: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Required class information is missing
> at com.hi.identify.multitenant.server.main.Server.handleExceptionDuringStart(Server.java:93)
> at com.hi.identify.multitenant.server.main.Server.main(Server.java:78)
> Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in com.hi.identify.multitenant.tenant.config.TenantSpringConfig: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Required class information is missing
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
> at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
> at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
> at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
> at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
> at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109)
> at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
> at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
> at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)
> at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)
> at com.hi.identify.multitenant.server.context.ServerFactory.loadSpringContext(ServerFactory.java:55)
> at com.hi.identify.multitenant.server.context.ServerFactory.create(ServerFactory.java:28)
> at com.hi.identify.multitenant.server.main.Server.main(Server.java:76)
> Caused by: java.lang.IllegalStateException: Required class information is missing
> at org.jboss.jandex.Indexer.rebuildNestedType(Indexer.java:926)
> at org.jboss.jandex.Indexer.resolveTypePath(Indexer.java:786)
> at org.jboss.jandex.Indexer.resolveTypeAnnotation(Indexer.java:705)
> at org.jboss.jandex.Indexer.resolveTypeAnnotations(Indexer.java:613)
> at org.jboss.jandex.Indexer.index(Indexer.java:1602)
> at org.hibernate.boot.archive.scan.spi.ClassFileArchiveEntryHandler.toClassDescriptor(ClassFileArchiveEntryHandler.java:64)
> at org.hibernate.boot.archive.scan.spi.ClassFileArchiveEntryHandler.handleEntry(ClassFileArchiveEntryHandler.java:52)
> at org.hibernate.boot.archive.internal.JarFileBasedArchiveDescriptor.visitArchive(JarFileBasedArchiveDescriptor.java:147)
> at org.hibernate.boot.archive.scan.spi.AbstractScannerImpl.scan(AbstractScannerImpl.java:48)
> at org.hibernate.boot.model.process.internal.ScanningCoordinator.coordinateScan(ScanningCoordinator.java:76)
> at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.prepare(MetadataBuildingProcess.java:98)
> at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:254)
> at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:168)
> at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:52)
> at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365)
> at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:391)
> at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:378)
> at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792)
> ... 14 common frames omitted
>
>
>
>
> Verzonden vanuit Mail <https://go.microsoft.com/fwlink/?LinkId=550986; voor Windows 10
>
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: spring context cannot load when I use postgres 42.2.15 or higher
@ 2020-10-29 19:07 Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
parent: Jonathan Strauss <rapidtransit@fastmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: Vladimir Sitnikov @ 2020-10-29 19:07 UTC (permalink / raw)
To: pgsql-jdbc@lists.postgresql.org; +Cc: Jonathan Strauss <rapidtransit@fastmail.com>
Just in case, I've filed https://github.com/wildfly/jandex/issues/92 so
jandex could produce more meaningful and actionable messages.
Hetty, could you share a reproducer?
Vladimir
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2020-10-29 19:07 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-10-29 14:04 spring context cannot load when I use postgres 42.2.15 or higher Hetty Kronemeijer <h.kronemeijer@humaninference.com>
2020-10-29 15:41 ` Jonathan Strauss <rapidtransit@fastmail.com>
2020-10-29 19:07 ` Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox