Quarkus: Spring Data JPA extension - java.lang.ClassNotFoundException: org.springframework.data.domain.Unpaged

Created on 14 Apr 2020  路  6Comments  路  Source: quarkusio/quarkus

Describe the bug
I'm getting a ClassNotFoundException in Quarkus 1.3.2.Final with the Spring Data JPA extension when I call org.springframework.data.domain.Pageable#unpaged.

Expected behavior
Should not throw Exceptions.

Actual behavior
Getting the following Exception at runtime:

...
Caused by: java.lang.ClassNotFoundException: org.springframework.data.domain.Unpaged
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 66 more

To Reproduce
Steps to reproduce the behavior:
Create a Quarkus project with "io.quarkus:quarkus-spring-data-jpa" extension and call org.springframework.data.domain.Pageable#unpaged.

arespring kinbug

Most helpful comment

Ok, I'll do it

All 6 comments

/cc @geoand

@aureamunoz seems like we need to add that class (and whatever else might be brought transitively) to the api jar.
We'll also need a test in Quarkus.

Ok, I'll do it

Hi @pucojazu,
I was not able to reproduce the issue. In fact the class in question is correctly included in the quarkus-spring-data-api 2.1.Final, see https://github.com/quarkusio/quarkus-spring-data-api/blob/9b10af0e454fd9627f345651dd25933af9888937/quarkus-spring-data-commons-api/pom.xml#L51 and Quarkus 1.3.2.Final is pulling this one.
In your error trace is the class org.springframework.data.domain.Unpaged that is not found but this one is not a class but a method in the Pageable class wich is correctly included.
Let me know if you need something else. Thanks

Hello @aureamunoz,
thanks for your quick response!
You're right that org.springframework.data.domain.Pageable#unpaged is a method. But this method returns an instance of the class org.springframework.data.domain.Unpaged which seems to be missing in quarkus-spring-data-commons-api-2.1.Final.jar
I can see the class in the original spring-data-commons: https://github.com/spring-projects/spring-data-commons/blob/master/src/main/java/org/springframework/data/domain/Unpaged.java
Could you include it in the Quarkus version, too?

oh, yes, ok. For some reason I didn't find either the Upaged class and thought that it was only a method. I'll add it.

Was this page helpful?
0 / 5 - 0 ratings