thymeleaf-layout-dialect icon indicating copy to clipboard operation
thymeleaf-layout-dialect copied to clipboard

java.lang.ExceptionInInitializerError: null error when using nativeRun

Open devondragon opened this issue 3 years ago • 5 comments

I am upgrading an app from SpringBoot 2.7 to 3.0 (and JDK 11 to JDK 19). Everything works fine, until I try to run the app as a Native build using GraalVM 19 22.3.0, where I get errors from the LayoutDialect lib. Any suggestions? Thanks!

Stacktrace attached:

stacktrace.txt

devondragon avatar Dec 06 '22 04:12 devondragon

I tried replicating the setup as the stack trace is unfortunately light on what exactly is null and causing things to crash. I haven't tried GraalVM before, so provided I'm following Spring Boot's instructions properly (https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html), I can get a JVM build working just fine but a native build I'm having trouble even getting it to finish! I might try again if I have some spare time later this week, but no I'm not sure why it might be acting like this at the moment 😕

ultraq avatar Dec 06 '22 20:12 ultraq

No problem, thank you for looking into it. If you need any help with the native build I will help if I can.

devondragon avatar Dec 06 '22 20:12 devondragon

This seems to be related to the Groovy code specifically. I tried switching to https://github.com/zhanhb/thymeleaf-layout-dialect as a test, and the error went away. (I still have some application issues with Native I need to address however).

devondragon avatar Jan 01 '23 20:01 devondragon

Thanks for sharing your findings 👍 I haven't had much luck getting this going myself, so if you'd like me to look into it further would you be able to provide a minimal project/repo that replicates the issue? I managed to get a workaround last week for something that feels a bit similar (a Groovy bytecode bug on a very specific configuration, #230) thanks to a test repo, so that might help me here too.

ultraq avatar Jan 02 '23 22:01 ultraq

Sure, I will try to create a simple test project (although it may not happen until the weekend). Thanks!

devondragon avatar Jan 04 '23 01:01 devondragon