Has anyone had any lucky generating a native image with Pedestal and all of its Metrics and SLF4J dependencies? I’m working my way through various issues and have hit a bit of a wall here.
Warning: Aborting stand-alone image build. Detected a FileDescriptor in the image heap. File descriptors opened during image generation are no longer open at image runtime, and the files might not even be presen>The culprit object has been instantiated by the 'com.codahale.metrics.ScheduledReporter' class initializer with the following trace:
at java.io.FileDescriptor.(FileDescriptor.java:127)
at java.io.FileOutputStream.(FileOutputStream.java:226)
at ch.qos.logback.core.recovery.ResilientFileOutputStream.(ResilientFileOutputStream.java:26)
at ch.qos.logback.core.FileAppender.openFile(FileAppender.java:206)
at ch.qos.logback.core.FileAppender.start(FileAppender.java:126)
at ch.qos.logback.core.rolling.RollingFileAppender.start(RollingFileAppender.java:104)
at ch.qos.logback.core.model.processor.AppenderModelHandler.postHandle(AppenderModelHandler.java:84)
I’ve seen an example of an older Pedestal app working in the https://github.com/clj-easy/graalvm-clojure/tree/master/pedestal but with clj-nix and Pedestal 0.6.3 things don’t work quite so nicely.I might be able to push a minimal repro up to GitHub in the coming days, if that helps.
In the meantime, any pointers from anyone who’s already walked this path would be immensely appreciated!
This is likely due to a top level expression in some code. Pushing it to a delay will likely solve the issue
I could open a PR to delay initialising telemetry on Pedestal. My concern is the effect such a change might have on downstream code.
well, you could at the very least first fork the project to see if this is the issue
@jcf which GraalVM version are you using?
I'm asking because this might solve the issue in graalvm 22, not sure: https://medium.com/graalvm/welcome-graalvm-for-jdk-22-8a48849f054c#df1e
@borkdude I haven’t upgraded from 21 yet. I can give 22 a try and loop back.