Skip to content

Cannot invoke "java.lang.Class.isInterface()" because "typeToRead" is null #29531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ramonmalcolm10 opened this issue Jan 22, 2022 · 1 comment
Labels
for: external-project For an external project and not something we can fix status: duplicate A duplicate of another issue

Comments

@ramonmalcolm10
Copy link

ramonmalcolm10 commented Jan 22, 2022

When using Spring data JPA projection, the application is failing to start with the following error:

Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Class.isInterface()" because "typeToRead" is null
	at org.springframework.data.jpa.repository.query.JpaQueryCreator.complete(JpaQueryCreator.java:181) ~[spring-data-jpa-2.6.1.jar:2.6.1]
	at org.springframework.data.jpa.repository.query.JpaQueryCreator.complete(JpaQueryCreator.java:152) ~[spring-data-jpa-2.6.1.jar:2.6.1]
	at org.springframework.data.jpa.repository.query.JpaQueryCreator.complete(JpaQueryCreator.java:59) ~[spring-data-jpa-2.6.1.jar:2.6.1]
	at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:95) ~[spring-data-commons-2.6.1.jar:2.6.1]
	at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:81) ~[spring-data-commons-2.6.1.jar:2.6.1]
	at org.springframework.data.jpa.repository.query.PartTreeJpaQuery$QueryPreparer.<init>(PartTreeJpaQuery.java:217) ~[spring-data-jpa-2.6.1.jar:2.6.1]
	at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:92) ~[spring-data-jpa-2.6.1.jar:2.6.1]
	... 84 common frames omitted

Affected Spring Boot version is 2.6.3.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 22, 2022
@wilkinsona
Copy link
Member

Thanks for the report. This looks like a bug in Spring Data JPA which is managed as a separate project. I believe it's a duplicate of spring-projects/spring-data-jpa#2408.

@wilkinsona wilkinsona added for: external-project For an external project and not something we can fix status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants