Open savinov opened 7 months ago
Similar issue in spring-data-mongodb: https://github.com/spring-projects/spring-data-mongodb/issues/3980
The issue has been fixed in spring-data-commons 3.3.0-M2: https://github.com/spring-projects/spring-data-commons/releases/tag/3.3.0-M2 https://github.com/spring-projects/spring-data-commons/issues/3056 https://github.com/spring-projects/spring-data-commons/pull/3059 https://github.com/spring-projects/spring-data-commons/commit/0766f2e56bc010d189810ff55bfbd620181b6808
The problem is spring-data-commons apply reflection to List parameter passed into repository stored procedure function. There is workaround: replace List parameter with array: https://github.com/savinov/cartridge-springdata-jdk17/commit/5e277eb4a3b48f27153b7bdccaa9a327e54af4a5
cartridge-springdata cannot be run with JRE17 because of strong internals encapsulation policy: https://openjdk.java.net/jeps/403
The problem is cartridge-springdata's TarantoolTemplate map parameters: https://github.com/tarantool/cartridge-springdata/blob/v0.5.3/src/main/java/org/springframework/data/tarantool/core/BaseTarantoolTemplate.java#L387
That mapping uses converter: https://github.com/tarantool/cartridge-springdata/blob/v0.5.3/src/main/java/org/springframework/data/tarantool/core/convert/MappingTarantoolWriteConverter.java#L103
The converter tries to get persisted entity from spring-data-common's AbstractMappingContext: https://github.com/spring-projects/spring-data-commons/blob/2.7.18/src/main/java/org/springframework/data/mapping/context/AbstractMappingContext.java#L575
AbstractMappingContext uses reflection to make fields accessable, but JRE17 restricts modifications on non-public API's.
Calling tarantool stored procedure from repository leads to InaccessibleObjectException.
Demo project with spring-data-tarantool 0.5.3 and spring-boot 2.7.18: https://github.com/savinov/cartridge-springdata-jdk17/tree/issue139
Run RepositoryTest
Result: