Hibernate Migration from 5.6 to 6.4

Facing below issue and I am clueless .

{“version”:1,“timeStamp”:“2024-08-02T09:38:25.654Z”,“level”:“error”,“source”:“sas-risk-modeling-core”,“message”:“Failed to initialize JPA EntityManagerFactory: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is java.lang.NullPointerException: Cannot invoke "org.hibernate.sql.ast.tree.from.TableReference.getIdentificationVariable()" because "tableReference" is null”,“properties”:{“logger”:“org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean”,“thread”:“main”}}

Hello, we’re going to need more information if you want anyone to help you:

  • when did you start getting this exception?
  • in what context does the error occur?
  • what do your mappings look like?

NPEs are usually caused by bugs. If you think this might be an Hibernate issue, please try to create a reproducer with our test case template and if you are able to reproduce the error, create a new ticket in our issue tracker and attach that reproducer. Note that 6.4 is also no longer supported, so I would strongly suggest upgrading to the latest stable instead.

when I am booting my application and I am getting this issue

{"version":1,"timeStamp":"2024-08-02T09:38:25.655Z","level":"warn","source":"sas-risk-modeling-core","message":"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.NullPointerException: Cannot invoke \"org.hibernate.sql.ast.tree.from.TableReference.getIdentificationVariable()\" because \"tableReference\" is null","properties":{"logger":"org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext","thread":"main"}}
{"version":1,"timeStamp":"2024-08-02T09:38:25.665Z","level":"info","source":"sas-risk-modeling-core","message":"Stopping service [Tomcat]","properties":{"logger":"org.apache.catalina.core.StandardService","thread":"main"}}
{"version":1,"timeStamp":"2024-08-02T09:38:25.726Z","level":"info","source":"sas-risk-modeling-core","message":"\n\nError starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.","properties":{"logger":"org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLogger","thread":"main"}}
{"version":1,"timeStamp":"2024-08-02T09:38:25.746Z","level":"error","source":"sas-risk-modeling-core","message":"Application run failed\norg.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.NullPointerException: Cannot invoke 

I have below properties in my legacy code are they correct for hibernate 6

spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext

spring.jpa.properties.hibernate.allow_update_outside_transaction=true

spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true

Again, we cannot help you in any way with this limited information. Once again, please provide a reproducer test case and we might be able to look into what’s going on.

how can I share reproducer test I am not sure as this issue is occuring while loading application only, I am sharing few more debug logs

{"version":1,"timeStamp":"2024-08-09T09:11:58.44Z","level":"debug","source":"abcd","message":"Created new SQL alias : ct4_0","properties":{"logger":"org.hibernate.orm.sql.ast.create","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.44Z","level":"debug","source":"abcd","message":"Registration of TableGroup [org.hibernate.sql.ast.tree.from.LazyTableGroup@5dd7d8f6] with identifierForTableGroup [treat(xxx.domain.data.preparation.abt.entities.ModelingAbtDerivedVariableSummary.usedVariables.{element} as xxx.domain.data.preparation.abt.entities.ModelingAbtTimeBasedVariableSummary).timePeriod] for NavigablePath [treat(xxx.domain.data.preparation.abt.entities.ModelingAbtDerivedVariableSummary.usedVariables.{element} as xxx.domain.data.preparation.abt.entities.ModelingAbtTimeBasedVariableSummary).timePeriod] ","properties":{"logger":"org.hibernate.orm.sql.ast.create","thread":"main"}}

{"version":1,"timeStamp":"2024-08-09T09:11:58.44Z","level":"debug","source":"abcd","message":"Created new SQL alias : tp3_0","properties":{"logger":"org.hibernate.orm.sql.ast.create","thread":"main"}}

{"version":1,"timeStamp":"2024-08-09T09:11:58.44Z","level":"debug","source":"abcd","message":"HHH000031: Closing","properties":{"logger":"org.hibernate.internal.SessionFactoryImpl","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.441Z","level":"debug","source":"abcd","message":"Implicitly destroying ServiceRegistry on de-registration of all child ServiceRegistries","properties":{"logger":"org.hibernate.service.internal.AbstractServiceRegistryImpl","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.442Z","level":"debug","source":"abcd","message":"Implicitly destroying Boot-strap registry on de-registration of all child ServiceRegistries","properties":{"logger":"org.hibernate.boot.registry.internal.BootstrapServiceRegistryImpl","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.445Z","level":"debug","source":"abcd","message":"Initializing SessionFactoryRegistry : org.hibernate.internal.SessionFactoryRegistry@7b7c613b","properties":{"logger":"org.hibernate.internal.SessionFactoryRegistry","thread":"main"}}

{"version":1,"timeStamp":"2024-08-09T09:11:58.445Z","level":"error","source":"abcd","message":"Failed to initialize JPA EntityManagerFactory: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is java.lang.NullPointerException: Cannot invoke \"org.hibernate.sql.ast.tree.from.TableReference.getIdentificationVariable()\" because \"tableReference\" is null","properties":{"logger":"org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean","thread":"main"}}



{"version":1,"timeStamp":"2024-08-09T09:11:58.445Z","level":"warn","source":"abcd","message":"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.NullPointerException: Cannot invoke \"org.hibernate.sql.ast.tree.from.TableReference.getIdentificationVariable()\" because \"tableReference\" is null","properties":{"logger":"org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.447Z","level":"debug","source":"abcd","message":"Custom destroy method 'close' on bean with name 'dataSource' completed","properties":{"logger":"org.springframework.beans.factory.support.DisposableBeanAdapter","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.448Z","level":"debug","source":"abcd","message":"Shutting down ExecutorService 'eventPublisherExecutor'","properties":{"logger":"org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.455Z","level":"debug","source":"abcd","message":"Shutting down ExecutorService 'arkeThreadPool'","properties":{"logger":"org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.455Z","level":"debug","source":"abcd","message":"Custom destroy method 'close' on bean with name 'prometheusMeterRegistry' completed","properties":{"logger":"org.springframework.beans.factory.support.DisposableBeanAdapter","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.457Z","level":"info","source":"abcd","message":"Stopping service [Tomcat]","properties":{"logger":"org.apache.catalina.core.StandardService","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.458Z","level":"debug","source":"abcd","message":"Unregister host [localhost] at domain [null] for service [StandardService[Tomcat]]","properties":{"logger":"org.apache.catalina.mapper.MapperListener","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.459Z","level":"debug","source":"abcd","message":"Unregister Context [/riskModelingCore] for service [StandardService[Tomcat]]","properties":{"logger":"org.apache.catalina.mapper.MapperListener","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.459Z","level":"debug","source":"abcd","message":"Unregister Wrapper [dispatcherServlet] in Context [/riskModelingCore] for service [StandardService[Tomcat]]","properties":{"logger":"org.apache.catalina.mapper.MapperListener","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.459Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [com.xxx.autoconfigure.commons.rest.boot.servlet.ShutdownFilterAutoConfiguration$RejectRequestsOnShutdownFilter] and name [rejectRequestsOnShutdownFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.459Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [com.xxx.security.oauth2.client.web.KeepaliveFilter] and name [keepaliveFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.459Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [com.xxx.commons.rest.locale.LanguageRangesHolderFilter] and name [languageRangesHolderFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.46Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [org.apache.tomcat.websocket.server.WsFilter] and name [Tomcat WebSocket (JSR356) Filter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.46Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [com.xxx.security.oauth2.sso.session.SessionLoggingFilter] and name [sessionLoggingFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.46Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [com.xxx.security.oauth2.sso.session.OpenIdSessionClaimFilter] and name [sessionClaimFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.46Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [com.xxx.commons.rest.logging.UsernameInsertingRequestFilter] and name [usernameFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.46Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [com.xxx.commons.web.security.csrf.CsrfRefererCheckingFilter] and name [csrfRefererCheckingFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.473Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter] and name [characterEncodingFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.473Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [xxx.common.application.filter.CharacterEncodingResponseFilter] and name [characterEncodingResponseFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.473Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [com.xxx.commons.rest.filters.ResponseHeaderFilter] and name [responseHeaderFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.474Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [com.xxx.commons.web.security.csrf.CsrfTokenResponseHeaderBindingFilter] and name [csrfFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.474Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [org.springframework.web.filter.ServerHttpObservationFilter] and name [webMvcObservationFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.474Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [com.xxx.authorization.config.deferred.DeferredDecisionHolderClearingFilter] and name [deferredDecisionHolderClearingFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.474Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [org.springframework.web.filter.CorsFilter] and name [corsFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.474Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [com.xxx.commons.rest.filters.HeaderValidatorFilter] and name [headerFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.474Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [com.xxx.commons.rest.exceptions.ExceptionCleanupFilter] and name [exceptionCleanupFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.474Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [com.xxx.commons.rest.client.http.PropagateHeadersFilter] and name [propagateHeadersFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.474Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [com.xxx.authorization.config.RequestDataFilter] and name [requestDataFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.474Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [org.springframework.boot.web.servlet.DelegatingFilterProxyRegistrationBean$1] and name [springSecurityFilterChain]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.474Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [com.xxx.security.oauth2.client.web.RunAsDelegateDomainFilter] and name [runAsDelegateDomainFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.474Z","level":"debug","source":"abcd","message":"JMX de-registration complete for filter of type [com.xxx.commons.web.security.headers.SecurityHeadersFilter] and name [securityHeadersFilter]","properties":{"logger":"org.apache.catalina.core.ApplicationFilterConfig","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.474Z","level":"debug","source":"abcd","message":"No persisted sessions to unload","properties":{"logger":"org.apache.catalina.session.StandardManager","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.475Z","level":"debug","source":"abcd","message":"Stopping this Loader","properties":{"logger":"org.apache.catalina.loader.WebappLoader","thread":"main"}}
{"version":1,"timeStamp":"2024-08-09T09:11:58.521Z","level":"debug","source":"abcd","message":"\n\n\n============================\nCONDITIONS EVALUATION REPORT\n============================\n\n\nPositive matches:\n-----------------\n\n   AopAutoConfiguration matched:\n      - @ConditionalOnProperty (spring.aop.auto=true) matched (OnPropertyCondition)\n\n   AopAutoConfiguration.AspectJAutoProxyingConfiguration matched:\n      - @ConditionalOnClass found required class 'org.aspectj.weaver.Advice' (OnClassCondition)\n\n   AopAutoConfiguration.AspectJAutoProxyingConfiguration.CglibAutoProxyConfiguration matched:\n      - @ConditionalOnProperty (spring.aop.proxy-target-class=true) matched (OnPropertyCondition)\n\n   ApplicationAvailabilityAutoConfiguration#applicationAvailability matched:\n      - @ConditionalOnMissingBean (types: org.springframework.boot.availability.ApplicationAvailability; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   ArkeConsumerAutoConfiguration matched:\n      - @ConditionalOnProperty ([xxx.event.enabled,xxx.event.configuration.enabled,xxx.event.arke.enabled]=true) matched (OnPropertyCondition)\n\n   ArkeConsumerAutoConfiguration#connectionConfigurationHolder matched:\n      - @ConditionalOnMissingBean (types: com.xxx.event.arke.impl.ConnectionConfigurationHolder; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   ArkeProducerAutoConfiguration matched:\n      - @ConditionalOnProperty ([xxx.event.enabled,xxx.event.configuration.enabled,xxx.event.arke.enabled]=true) matched (OnPropertyCondition)\n\n   AuditAutoConfiguration matched:\n      - @ConditionalOnProperty (management.auditevents.enabled) matched (OnPropertyCondition)\n      - @ConditionalOnBean (types: org.springframework.boot.actuate.audit.AuditEventRepository; SearchStrategy: all) found bean 'auditEventRepository' (OnBeanCondition)\n\n   AuditAutoConfiguration#auditListener matched:\n      - @ConditionalOnMissingBean (types: org.springframework.boot.actuate.audit.listener.AbstractAuditListener; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   AuditAutoConfiguration#authenticationAuditListener matched:\n      - @ConditionalOnClass found required class 'org.springframework.security.authentication.event.AbstractAuthenticationEvent' (OnClassCondition)\n      - @ConditionalOnMissingBean (types: org.springframework.boot.actuate.security.AbstractAuthenticationAuditListener; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   AuditAutoConfiguration#authorizationAuditListener matched:\n      - @ConditionalOnClass found required class 'org.springframework.security.access.event.AbstractAuthorizationEvent' (OnClassCondition)\n      - @ConditionalOnMissingBean (types: org.springframework.boot.actuate.security.AbstractAuthorizationAuditListener; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   AuthorizationBootstrapRuleLoaderAutoConfiguration matched:\n      - @ConditionalOnProperty (xxx.authorization.remote) matched (OnPropertyCondition)\n\n   AuthorizationBootstrapRuleLoaderAutoConfiguration#authorizationBootstrapRuleLoader matched:\n      - @ConditionalOnMissingBean (types: com.xxx.authorization.bootstrap.RuleLoader; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   AuthorizationBootstrapRulePatcherAutoConfiguration matched:\n      - @ConditionalOnProperty (xxx.authorization.remote) matched (OnPropertyCondition)\n\n   AuthorizationBootstrapRulePatcherAutoConfiguration#authorizationBootstrapRulePatcher matched:\n      - @ConditionalOnMissingBean (types: com.xxx.authorization.bootstrap.RulePatcher; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   AuthorizationClientCacheAutoConfiguration#clientCacheController matched:\n      - @ConditionalOnProperty (xxx.authorization.remote) matched (OnPropertyCondition)\n\n   AuthorizationConfiguration#parameterNameDiscoverer matched:\n      - @ConditionalOnMissingBean (types: org.springframework.core.ParameterNameDiscoverer; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   AutoServiceRegistrationAutoConfiguration matched:\n      - @ConditionalOnProperty (spring.cloud.service-registry.auto-registration.enabled) matched (OnPropertyCondition)\n\n   AutoServiceRegistrationConfiguration matched:\n      - @ConditionalOnProperty (spring.cloud.service-registry.auto-registration.enabled) matched (OnPropertyCondition)\n\n   AvailabilityProbesAutoConfiguration matched:\n      - Probes availability 'management.endpoint.health.probes.enabled' set to 'true' (AvailabilityProbesAutoConfiguration.ProbesCondition)\n\n   AvailabilityProbesAutoConfiguration#livenessStateHealthIndicator matched:\n      - @ConditionalOnMissingBean (names: livenessStateHealthIndicator; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   AvailabilityProbesAutoConfiguration#readinessStateHealthIndicator matched:\n      - @ConditionalOnMissingBean (names: readinessStateHealthIndicator; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   BootstrapAutoConfiguration#bootstrapHealthIndicator matched:\n      - @ConditionalOnProperty (xxx.management.indicator.bootstrap.enabled=true) matched (OnPropertyCondition)\n\n   CacheMeterBinderProvidersConfiguration matched:\n      - @ConditionalOnClass found required class 'io.micrometer.core.instrument.binder.MeterBinder' (OnClassCondition)\n\n   CaffeineCacheAutoConfiguration matched:\n      - @ConditionalOnMissingBean (types: com.xxx.commons.caching.CacheFactory; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   CasInitializationBootstrapAutoConfiguration#initialCaslibBootstrapper matched:\n      - @ConditionalOnMissingBean (types: com.xxx.cas.initialization.bootstrap.caslib.CaslibBootstrapper; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   CasInitializationBootstrapAutoConfiguration#initialTableBootstrapper matched:\n      - @ConditionalOnMissingBean (types: com.xxx.cas.initialization.bootstrap.table.TableBootstrapper; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   CommonsClientAutoConfiguration.ActuatorConfiguration matched:\n      - @ConditionalOnClass found required class 'org.springframework.boot.actuate.endpoint.annotation.Endpoint' (OnClassCondition)\n      - @ConditionalOnProperty (spring.cloud.features.enabled) matched (OnPropertyCondition)\n\n   CommonsClientAutoConfiguration.DiscoveryLoadBalancerConfiguration matched:\n      - @ConditionalOnClass found required class 'org.springframework.boot.actuate.health.HealthIndicator' (OnClassCondition)\n      - @ConditionalOnProperty (spring.cloud.discovery.enabled) matched; @ConditionalOnProperty (spring.cloud.discovery.blocking.enabled) matched (OnPropertyCondition)\n      - @ConditionalOnBean (types: org.springframework.cloud.client.discovery.DiscoveryClient; SearchStrategy: all) found beans 'simpleDiscoveryClient', 'consulDiscoveryClient', 'compositeDiscoveryClient' (OnBeanCondition)\n\n   CommonsClientAutoConfiguration.DiscoveryLoadBalancerConfiguration#discoveryClientHealthIndicator matched:\n      - @ConditionalOnProperty (spring.cloud.discovery.client.health-indicator.enabled) matched (OnPropertyCondition)\n\n   CommonsClientAutoConfiguration.DiscoveryLoadBalancerConfiguration#discoveryCompositeHealthContributor matched:\n      - @ConditionalOnProperty (spring.cloud.discovery.client.composite-indicator.enabled) matched (OnPropertyCondition)\n      - @ConditionalOnBean (types: org.springframework.cloud.client.discovery.health.DiscoveryHealthIndicator; SearchStrategy: all) found bean 'discoveryClientHealthIndicator' (OnBeanCondition)\n\n   CommonsEndpointAutoConfiguration matched:\n      - @ConditionalOnProperty (xxx.management.indicator.commons.enabled=true) matched (OnPropertyCondition)\n\n   CommonsRestClientAutoConfiguration#getServiceUriResolver matched:\n      - @ConditionalOnBean (types: com.xxx.commons.context.service.ServiceResolver; SearchStrategy: all) found bean 'consulServiceResolver'; @ConditionalOnMissingBean (types: com.xxx.commons.rest.client.ServiceURIResolver; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   CommonsRestClientAutoConfiguration#urlExternalizer matched:\n      - @ConditionalOnBean (types: com.xxx.commons.context.service.ServiceResolver; SearchStrategy: all) found bean 'consulServiceResolver'; @ConditionalOnMissingBean (types: com.xxx.commons.rest.client.UrlExternalizer; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   CompatibilityVerifierAutoConfiguration matched:\n      - @ConditionalOnProperty (spring.cloud.compatibility-verifier.enabled) matched (OnPropertyCondition)\n\n   CompositeMeterRegistryAutoConfiguration matched:\n      - @ConditionalOnClass found required class 'io.micrometer.core.instrument.composite.CompositeMeterRegistry' (OnClassCondition)\n\n   ComputeBootstrapAutoConfiguration#computeContextRequestLoader matched:\n      - @ConditionalOnMissingBean (types: com.xxx.compute.bootstrap.ComputeContextRequestLoader; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   ConfigurationBootstrapAutoConfiguration#configurationRetryInterceptor matched:\n      - @ConditionalOnMissingBean (names: configurationRetryInterceptor; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   ConfigurationPropertiesRebinderAutoConfiguration matched:\n      - @ConditionalOnBean (types: org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor; SearchStrategy: all) found bean 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor' (OnBeanCondition)\n\n   ConfigurationPropertiesRebinderAutoConfiguration#configurationPropertiesBeans matched:\n      - @ConditionalOnMissingBean (types: org.springframework.cloud.context.properties.ConfigurationPropertiesBeans; SearchStrategy: current) did not find any beans (OnBeanCondition)\n\n   ConfigurationPropertiesRebinderAutoConfiguration#configurationPropertiesRebinder matched:\n      - @ConditionalOnMissingBean (types: org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder; SearchStrategy: current) did not find any beans (OnBeanCondition)\n\n   ConsulAutoConfiguration matched:\n      - AllNestedConditions 2 matched 0 did not; NestedCondition on ConditionalOnConsulEnabled.OnConsulEnabledCondition.FoundClass @ConditionalOnClass found required class 'com.ecwid.consul.v1.ConsulClient'; NestedCondition on ConditionalOnConsulEnabled.OnConsulEnabledCondition.FoundProperty @ConditionalOnProperty (spring.cloud.consul.enabled) matched (ConditionalOnConsulEnabled.OnConsulEnabledCondition)\n\n   ConsulAutoConfiguration#consulProperties matched:\n      - @ConditionalOnMissingBean (types: org.springframework.cloud.consul.ConsulProperties; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   ConsulAutoConfiguration#consulRawClientBuilderSupplier matched:\n      - @ConditionalOnMissingBean (types: com.ecwid.consul.v1.ConsulRawClient$Builder; SearchStrategy: all) did not find any beans (OnBeanCondition)\n\n   ConsulAutoConfiguration.ConsulHealthConfig matched:\n      - 

Please share the full stack trace of the exception.

where should I share the logs .As it is big file can you share email id so that i can attach log

We don’t need to see logs, the stacktrace showing the exception is enough.

{“version”:1,“timeStamp”:“2024-08-28T05:47:55.104Z”,“level”:“error”,“source”:“DaoProject”,“message”:“Application run failed\norg.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.NullPointerException: Cannot invoke "org.hibernate.sql.ast.tree.from.TableReference.getIdentificationVariable()" because "tableReference" is null\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1788)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)\n\tat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:205)\n\tat org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:952)\n\tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624)\n\tat org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)\n\tat org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)\n\tat org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:335)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1363)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1352)\n\tat com.sas.cs.core.Application.main(Application.java:20)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:569)\n\tat org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)\n\tat org.springframework.boot.loader.Launcher.launch(Launcher.java:108)\n\tat org.springframework.boot.loader.Launcher.launch(Launcher.java:58)\n\tat org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)\nCaused by: jakarta.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is java.lang.NullPointerException: Cannot invoke "org.hibernate.sql.ast.tree.from.TableReference.getIdentificationVariable()" because "tableReference" is null\n\tat org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:421)\n\tat org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396)\n\tat org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:366)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1835)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1784)\n\t… 23 common frames omitted\nCaused by: java.lang.NullPointerException: Cannot invoke "org.hibernate.sql.ast.tree.from.TableReference.getIdentificationVariable()" because "tableReference" is null\n\tat org.hibernate.sql.ast.spi.SqlExpressionResolver.createColumnReferenceKey(SqlExpressionResolver.java:62)\n\tat org.hibernate.sql.ast.spi.SqlExpressionResolver.createColumnReferenceKey(SqlExpressionResolver.java:56)\n\tat org.hibernate.metamodel.mapping.ordering.ast.ColumnReference.resolve(ColumnReference.java:62)\n\tat org.hibernate.metamodel.mapping.ordering.ast.ColumnReference.apply(ColumnReference.java:93)\n\tat org.hibernate.metamodel.mapping.ordering.OrderByFragmentImpl.apply(OrderByFragmentImpl.java:35)\n\tat org.hibernate.loader.ast.internal.LoaderSelectBuilder.applyOrdering(LoaderSelectBuilder.java:753)\n\tat org.hibernate.loader.ast.internal.LoaderSelectBuilder.applyOrdering(LoaderSelectBuilder.java:739)\n\tat org.hibernate.loader.ast.internal.LoaderSelectBuilder.generateSelect(LoaderSelectBuilder.java:531)\n\tat org.hibernate.loader.ast.internal.LoaderSelectBuilder.createSelect(LoaderSelectBuilder.java:258)\n\tat org.hibernate.loader.ast.internal.CollectionLoaderSingleKey.(CollectionLoaderSingleKey.java:56)\n\tat org.hibernate.loader.ast.internal.AbstractCollectionBatchLoader.(AbstractCollectionBatchLoader.java:54)\n\tat org.hibernate.loader.ast.internal.CollectionBatchLoaderArrayParam.(CollectionBatchLoaderArrayParam.java:64)\n\tat org.hibernate.loader.ast.internal.StandardBatchLoaderFactory.createCollectionBatchLoader(StandardBatchLoaderFactory.java:61)\n\tat org.hibernate.persister.collection.AbstractCollectionPersister.createNamedQueryCollectionLoader(AbstractCollectionPersister.java:773)\n\tat org.hibernate.persister.collection.AbstractCollectionPersister.postInstantiate(AbstractCollectionPersister.java:619)\n\tat java.base/java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4780)\n\tat org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl.finishInitialization(MappingMetamodelImpl.java:209)\n\tat org.hibernate.internal.SessionFactoryImpl.initializeMappingModel(SessionFactoryImpl.java:364)\n\tat org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:293)\n\tat org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:450)\n\tat org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1507)\n\tat org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:75)\n\tat org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:390)\n\tat org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409)\n\t… 27 common frames omitted\n”,“properties”:{“logger”:“org.springframework.boot.SpringApplication”,“thread”:“main”}}

Looks like one of the uses of @OrderBy/@SQLOrder on a collection might be causing this error.

Please try to create a reproducer with our test case template and if you are able to reproduce the issue, create a bug ticket in our issue tracker and attach that reproducer.