Here is the full stack trace
[06:44:17.423] [http-nio-8080-exec-2] [WARN ] o.h.e.jdbc.spi.SqlExceptionHelper - [0499ff1e-d249-4979-819b-8b9183d753a0] - SQL Error: 17006, SQLState: 99999
"[06:44:17.424] [http-nio-8080-exec-2] [ERROR] o.h.e.jdbc.spi.SqlExceptionHelper - [0499ff1e-d249-4979-819b-8b9183d753a0] - Invalid column name
"EXCEPTION OCCOURED org.springframework.orm.jpa.JpaSystemException: Unable to find column position by name: ID [Invalid column name] [n/a]
[Ljava.lang.StackTraceElement;@24e529ef
Print org.springframework.orm.jpa.JpaSystemException: Unable to find column position by name: ID [Invalid column name] [n/a]
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:321)
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:230)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:550)
at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:152)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:134)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:218)
at jdk.proxy2/jdk.proxy2.$Proxy219.findAllAuditsByDossierIdAndOriginApplication(Unknown Source)
on the below method invoking query. Sorry Can’t share the much code
@Query(value = " SELECT DM.ID as name1 , DT.ID as name2 from "
"AUDITS DM INNER JOIN "
"AUDITS_INFO DT ON DM.ID = DT.ID " ,nativeQuery = true)
List findAllAuditHistory(@Param(“id”) ;
The stack trace does not show where the error originates from, just where Spring wraps and rethrows the exception.
Without the entity model I can’t really help you, but either way, it looks like you have to use a result set mapping or you simply remove the second select item.