I make some tests with Hibernate 7 and I have a NoClassDefFoundError: NoClassDefFoundError: org/hibernate/query/BindableType
On migration guide (7.0 Migration Guide) , I found :
Incubating interfaces BindableType, OutputableType, and BindingContext were moved to org.hibernate.type
have similar issue when i call @Query native, the difference in package : org.hibernate.query.BindableType but in git package is org.hibernate.type.BindableType
org.hibernate.query
org.hibernate.type
I also have this issue and in my case it’s likely caused by using spring-data-jpa version 3.5.4:
java.lang.NoClassDefFoundError: org/hibernate/query/BindableType
at org.springframework.data.jpa.repository.query.AbstractJpaQuery.obtainParameterAccessor(AbstractJpaQuery.java:170)
at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:159)
at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:148)
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:170)\
doesn’t contain any references to org/hibernate/query/BindableType at the source level,
but it fails at runtime. Looking at the disassembled code, I found this:
When compiled, Java resolves the type and silently causes the issue.
As a workaround, while waiting for the final release of Spring Data JPA 4.0 natively supporting Hibernate 7,
I imported a local copy of HibernateJpaParametersParameterAccessor, which, when compiled against Hibernate 7,
correctly resolves the type.
Other than that, I haven’t encountered any problems — and I’ve tested it with dozens of jpql queries.
The first native query I had to write caused the problem, which I resolved as described above.