spring-projects/spring-boot

BackgroundPreinitializer doesn't work with AOT

dsyer opened this issue · 3 comments

dsyer commented

The BackgroundPreinitializer is written in a style of try/catch/swallow to deal with classes that aren't available at runtime. It's easier on the eye than checking for each class before trying to use it, but it doesn't work with Graal AOT (the BackgroundPreinitializer just errors out on line 83, the Tomcat MBeans, if Tomcat is not on the classpath, and then never recovers).

Possibly related oracle/graal#622 and #14147

Tempted to see how oracle/graal#622 plays out before we rush to change this. I imagine we've a more cases like that.

@dsyer I've added a new label called theme: graal to track all these related issues. I think we'll need to wait for Spring Boot 2.2 before we can really tackle it in any meaningful form. Probably the first one we should fix is #14216 so that we can have a CI for it.

It looks like oracle/graal#622 has been accepted so I'll close this one with the hope that they fix it in the VM. If they can't/won't fix the VM issue then we can reopen this one.

BTW: Feel free to add the theme label to any issues I missed.