spring-projects / spring-data-relational

Spring Data Relational. Home of Spring Data JDBC and Spring Data R2DBC.
https://spring.io/projects/spring-data-jdbc
Apache License 2.0
737 stars 339 forks source link

Bug: ClassNotFoundException: net.sf.jsqlparser.statement.select.Values #1801

Closed barbetb closed 1 month ago

barbetb commented 1 month ago

I have the following statement:

`@Repository public interface VersionRepository extends JpaRepository<Version, String>{

    @Query(value = "SELECT * FROM (SELECT v.version FROM VERSION_TABLE v ORDER BY RegExp_Replace(RegExp_Replace (v.version || '.', 'some regex'),  'another regex', '\\1') DESC) WHERE rownum =1", nativeQuery = true)
    String getLatestDbVersionNative();

} `

I get the error: ClassNotFoundException: net.sf.jsqlparser.statement.select.Values

I found that spring boot 3.3.0 includes spring-boot-starter-data-jdbc 3.2.3 with jsqlparser 4.6

When I override that jsqlparser version with version 4.9 the error is fixed.

I looks like an upgrade is needed.

mp911de commented 1 month ago

Jsqlparser is a test-only dependency, the fix will come via spring-projects/spring-data-relational#1796. Until then, either exclude the JDBC dependency or pin the dependency version, please.