Thread: spring context cannot load when I use postgres 42.2.15 or higher

spring context cannot load when I use postgres 42.2.15 or higher

From
Hetty Kronemeijer
Date:
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 voor Windows 10

 

Re: spring context cannot load when I use postgres 42.2.15 or higher

From
Tom Lane
Date:
Hetty Kronemeijer <h.kronemeijer@humaninference.com> writes:
> 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.

You might have better luck asking about this on the
pgsql-jdbc@lists.postgresql.org mailing list.  This list is mostly for
issues with the core Postgres server, which I don't think this is.

            regards, tom lane



Re: spring context cannot load when I use postgres 42.2.15 or higher

From
Dave Cramer
Date:


On Thu, 29 Oct 2020 at 10:02, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Hetty Kronemeijer <h.kronemeijer@humaninference.com> writes:
> 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.

You might have better luck asking about this on the
pgsql-jdbc@lists.postgresql.org mailing list.  This list is mostly for
issues with the core Postgres server, which I don't think this is.

                        regards, tom lane


Sorry for the very late reply.

Can you try using the latest version 42.2.18


Dave Cramer
www.postgres.rocks