I was getting an NullPointerException when using a findAll with a pageable.
public Page<Issue> getAllIssuePageList(Integer pageNumber, Integer size){
Pageable pageSignature = PageRequest.of(pageNumber, size);
return issueRepository.findAll(pageSignature);
}
Repository I am calling:
@Repository
public interface IssueRepository extends JpaRepository<Issue, Integer> {
}
This is the core of the stack trace below:
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: java.lang.IllegalStateException: Failed to execute ApplicationRunner
Caused by: java.lang.NullPointerException: null
at org.hibernate.query.sqm.internal.SqmCriteriaNodeBuilder.count(SqmCriteriaNodeBuilder.java:499) ~[hibernate-core-6.0.0.Alpha4.jar:6.0.0.Alpha4]
at org.hibernate.query.sqm.internal.SqmCriteriaNodeBuilder.count(SqmCriteriaNodeBuilder.java:115) ~[hibernate-core-6.0.0.Alpha4.jar:6.0.0.Alpha4]
The same code executed perfectly when I switched the version number to 5.4.0.Final |