You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In one of the projects I'm working now we decide to upgrade to SpringBoot 2.6.3
And as part of the upgrade one of the problems that we detect is:
Caused by: java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.List infrastructure.document.SpringDataDocumentRepository. findByMortgageRequestIdOrderByCreationDateDesc(java.lang.String)! null
at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:96)
at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:113)
at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:254)
at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:87)
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.lookupQuery(QueryExecutorMethodInterceptor.java:102)
... 80 common frames omitted
Caused by: java.lang.NullPointerException: null
at org.springframework.data.jpa.repository.query.JpaQueryCreator.complete(JpaQueryCreator.java:181)
at org.springframework.data.jpa.repository.query.JpaQueryCreator.complete(JpaQueryCreator.java:152)
at org.springframework.data.jpa.repository.query.JpaQueryCreator.complete(JpaQueryCreator.java:59)
at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:95)
at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:81)
at org.springframework.data.jpa.repository.query.PartTreeJpaQuery$QueryPreparer.<init>(PartTreeJpaQuery.java:217)
at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:92)
... 84 common frames omitted
After having a look, seems that the method getTypeToRead() is returning a null under certain circumstances:
How is posible that is solved in 2.6.1 and fails in that exact version?
I don't think anybody said this is fixed in 2.6.1
The fix will be included in the next releases of the 2.6, 2.7 and 3.0 branches: 2.6.2, 2.7.0-M3, and 3.0.0-M2
You can tell by the branches and tags the fixing commits are contained in.
If it is in a tag for a version the fix is included in that version. if it only in main or a version.x branch it will be included in those branches next version.
Hi guys:
In one of the projects I'm working now we decide to upgrade to SpringBoot 2.6.3
And as part of the upgrade one of the problems that we detect is:
After having a look, seems that the method getTypeToRead() is returning a null under certain circumstances:
but is not controlled in the code that requested in JpaQueryCreator and fails running this command:
query = typeToRead.isInterface() ? query.multiselect(selections) : query.select((Selection) builder.construct(typeToRead, selections.toArray(new Selection[0])));
JpaQueryCreator:
Why if the interface projection has the same properties as the input properties, is declared as closed and is required to return null?
public boolean isClosed() { return this.properties.equals(this.getInputProperties()); }
and why check if the TypeToRead is an interface over a possible null value?
If this helps, this are the classes that I have in my project and produce the error after the migration from SpringDataJpa 2.4.X to 2.6.X.
Entity embeddable id:
Document entity:
Projection interface
Repository
Any idea to solve this specific scenario?
The text was updated successfully, but these errors were encountered: