# Hibernate Migration from 5.6 to 6.4

**URL:** <https://discourse.hibernate.org/t/hibernate-migration-from-5-6-to-6-4/10066>\
**Category:** Hibernate ORM\
**Created:** [August 4, 2024, 5:52pm UTC](https://discourse.hibernate.org/t/hibernate-migration-from-5-6-to-6-4/10066 "2024-08-04T17:52:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohit\_Mehra](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/mohit_mehra/32/3398_2.png) [@Mohit\_Mehra](https://discourse.hibernate.org/u/Mohit_Mehra)\
**Post date:** [August 4, 2024, 5:52pm UTC](https://discourse.hibernate.org/t/hibernate-migration-from-5-6-to-6-4/10066/1 "2024-08-04T17:52:22Z")

</div>

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”}}

---

<div class="post-metadata">

**Author:** ![mbladel](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/mbladel/32/2128_2.png) [@mbladel](https://discourse.hibernate.org/u/mbladel)\
**Post date:** [August 5, 2024, 7:21am UTC](https://discourse.hibernate.org/t/hibernate-migration-from-5-6-to-6-4/10066/2 "2024-08-05T07:21:01Z")

</div>

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](https://github.com/hibernate/hibernate-test-case-templates/blob/master/orm/hibernate-orm-6/src/test/java/org/hibernate/bugs/JPAUnitTestCase.java) and if you are able to reproduce the error, create a new ticket in our [issue tracker](https://hibernate.atlassian.net/browse/HHH) and attach that reproducer. Note that 6.4 is also no longer supported, so I would strongly suggest upgrading to the [latest stable](https://hibernate.org/orm/releases) instead.

---

<div class="post-metadata">

**Author:** ![Mohit\_Mehra](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/mohit_mehra/32/3398_2.png) [@Mohit\_Mehra](https://discourse.hibernate.org/u/Mohit_Mehra)\
**Post date:** [August 5, 2024, 7:49am UTC](https://discourse.hibernate.org/t/hibernate-migration-from-5-6-to-6-4/10066/3 "2024-08-05T07:49:56Z")

</div>

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

```auto
{"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

---

<div class="post-metadata">

**Author:** ![mbladel](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/mbladel/32/2128_2.png) [@mbladel](https://discourse.hibernate.org/u/mbladel)\
**Post date:** [August 5, 2024, 12:24pm UTC](https://discourse.hibernate.org/t/hibernate-migration-from-5-6-to-6-4/10066/4 "2024-08-05T12:24:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mohit\_Mehra](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/mohit_mehra/32/3398_2.png) [@Mohit\_Mehra](https://discourse.hibernate.org/u/Mohit_Mehra)\
**Post date:** [August 12, 2024, 8:30am UTC](https://discourse.hibernate.org/t/hibernate-migration-from-5-6-to-6-4/10066/5 "2024-08-12T08:30:07Z")

</div>

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

```auto
{"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 - 

```

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [August 13, 2024, 12:08pm UTC](https://discourse.hibernate.org/t/hibernate-migration-from-5-6-to-6-4/10066/6 "2024-08-13T12:08:57Z")

</div>

Please share the full stack trace of the exception.

---

<div class="post-metadata">

**Author:** ![Mohit\_Mehra](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/mohit_mehra/32/3398_2.png) [@Mohit\_Mehra](https://discourse.hibernate.org/u/Mohit_Mehra)\
**Post date:** [August 20, 2024, 6:57am UTC](https://discourse.hibernate.org/t/hibernate-migration-from-5-6-to-6-4/10066/8 "2024-08-20T06:57:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [August 22, 2024, 1:15pm UTC](https://discourse.hibernate.org/t/hibernate-migration-from-5-6-to-6-4/10066/9 "2024-08-22T13:15:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mohit\_Mehra](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/mohit_mehra/32/3398_2.png) [@Mohit\_Mehra](https://discourse.hibernate.org/u/Mohit_Mehra)\
**Post date:** [August 28, 2024, 5:50am UTC](https://discourse.hibernate.org/t/hibernate-migration-from-5-6-to-6-4/10066/11 "2024-08-28T05:50:14Z")

</div>

{“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”}}

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [September 11, 2024, 11:44am UTC](https://discourse.hibernate.org/t/hibernate-migration-from-5-6-to-6-4/10066/12 "2024-09-11T11:44:08Z")

</div>

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](https://github.com/hibernate/hibernate-test-case-templates/blob/master/orm/hibernate-orm-6/src/test/java/org/hibernate/bugs/JPAUnitTestCase.java) and if you are able to reproduce the issue, create a bug ticket in our [issue tracker](https://hibernate.atlassian.net) and attach that reproducer.
