From: Jonathan Strauss <rapidtransit@fastmail.com>
To: pgsql-jdbc@lists.postgresql.org
Subject: Re: spring context cannot load when I use postgres 42.2.15 or higher
Date: Thu, 29 Oct 2020 11:41:12 -0400
Message-ID: <f86ab46f-4283-4fbb-9d8d-460eaef4cf5a@www.fastmail.com> (raw)
In-Reply-To: <AM0PR04MB652919E6F344C84DC3073D0D96140@AM0PR04MB6529.eurprd04.prod.outlook.com>
References: <AM0PR04MB652919E6F344C84DC3073D0D96140@AM0PR04MB6529.eurprd04.prod.outlook.com>
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
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: rapidtransit@fastmail.com
Subject: Re: spring context cannot load when I use postgres 42.2.15 or higher
In-Reply-To: <f86ab46f-4283-4fbb-9d8d-460eaef4cf5a@www.fastmail.com>
References: <AM0PR04MB652919E6F344C84DC3073D0D96140@AM0PR04MB6529.eurprd04.prod.outlook.com> <f86ab46f-4283-4fbb-9d8d-460eaef4cf5a@www.fastmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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