jackson-databind-nullable icon indicating copy to clipboard operation
jackson-databind-nullable copied to clipboard

Version 0.2.8 fails with ResolutionException

Open aschepp opened this issue 2 months ago • 5 comments

We just tried to update to 0.2.8 from 0.2.7 and our project fails to start with:

java.lang.module.ResolutionException: Module org.openapitools.jackson.nullable does not read a module that exports javax.validation.valueextraction

This is probably because of #62

aschepp avatar Nov 07 '25 14:11 aschepp

How exactly are you running your project?

If you are using JLink, there is a known bug (https://bugs.openjdk.org/browse/JDK-8347915) that was fixed in JDK 25. You do not have to use Java 25, just build the project with 25.

However, your log output has the java.lang.module.ResolutionException: prefix, which usually does not appear with JLink. So I am curious how you are running your project so I can reproduce the problem. A minimal example project which reproduces the problem would also be helpful.

Til7701 avatar Nov 07 '25 21:11 Til7701

Not sure if this is what the original reporter was doing, but I've attached something that seems to reproduce the problem. (Also not sure if it's a realistic use case, but I found it by trying to run the main method within IntelliJ.)

issue-100.zip Unzip, and execute ./run.sh. This will do a compile with mvn, then attempt to run the files directly with java. The java command was created based on what I saw IntelliJ generating when using the UI to execute the main method directly.

Java 17 output is what the original issue reported. Java 25 output is a ClassNotFound issue.

nrayburn-tech avatar Nov 08 '25 19:11 nrayburn-tech

Ok, this is the same issue as I linked above. I thought it was just JLink, but also happens when running with the --module-path arg. The same error message is also mentioned in the bug report linked in my link.

I think the best compromise is to remove the SPI entries in the module-info for the optional dependencies. This enables running with JDK 24 or lower. However, it makes it impossible to use the SPI to load the ValueExtractor implementations when using the module path. As far as I can tell, this was already the case before.

When using the class path, everything should still work the same as before 0.2.8.

I will open a PR shortly for this including some integration tests.

Til7701 avatar Nov 08 '25 22:11 Til7701

We are using Java 21. The error came from a unit test (maven surefire), that didn't run. Sadly, I didn't have the time to create an example project for you on Friday, but it looks like you figured it out. I will test the proposed solution.

aschepp avatar Nov 10 '25 10:11 aschepp

I can confirm, the proposed solution fixes the problem. Thank you very much for your quick response.

aschepp avatar Nov 10 '25 10:11 aschepp