Building AWS SES Lambda with javax mail.
Error: Classes that should be initialized at run time got initialized during image building:
org.slf4j.impl.OutputChoice$1 was unintentionally initialized at build time. To see why org.slf4j.impl.OutputChoice$1 got initialized use --trace-class-initialization=org.slf4j.impl.OutputChoice$1
com.oracle.svm.core.util.UserError$UserException: Classes that should be initialized at run time got initialized during image building:
org.slf4j.impl.OutputChoice$1 was unintentionally initialized at build time. To see why org.slf4j.impl.OutputChoice$1 got initialized use --trace-class-initialization=org.slf4j.impl.OutputChoice$1
however I have it in my
:native-image-args ["--verbose"
"--no-fallback"
"--report-unsupported-elements-at-runtime"
"-H:+AllowIncompleteClasspath"
"-H:+ReportExceptionStackTraces"
"--initialize-at-build-time=org.slf4j.impl.OutputChoice"
"--initialize-at-build-time=com.fasterxml.jackson,org.slf4j.LoggerFactory,org.slf4j.impl.StaticLoggerBinder,org.slf4j.impl.SimpleLogger,javax.xml.parsers.FactoryFinder,com.sun.org.apache.xerces.internal,jdk.xml.internal.JdkXmlUtils,javax.xml.namespace.QName,org.slf4j.LoggerFactory,org.slf4j.impl.StaticLoggerBinder,org.slf4j.impl.SimpleLogger,io.opentracing.util.GlobalTracer"
"--initialize-at-build-time=jdk.xml.internal.SecuritySupport,jdk.xml.internal.JdkConstants"
"-Dio.pedestal.log.defaultMetricsRecorder=nil"
"--no-server"]}}This is internal graalvm error
You have to report it upstream to graalvm team
Try to provide just org.slf4j
The $1 signals it’s some inner class.
Warning: Could not register complete reflection metadata for org.apache.commons.logging.impl.Log4JLogger. Reason(s): java.lang.NoClassDefFoundError: org/apache/log4j/Priority
# Printing 1 class initialization trace(s) of class(es) traced by TraceClassInitialization to: /project/.holy-lambda/build/reports/traced_class_initialization_20240228_055601.txt
2024-02-28 05:55:32:062 +0000 [main] DEBUG io.netty.util.internal.logging.InternalLoggerFactory - Using SLF4J as the default logging framework
I found that software.amazon.awssdk/ses {:mvn/version "2.24.8" causes build troubles. How can I exclude (io.netty.util.internal.logging.InternalLoggerFactory) from deps?I think this better fit to #graalvm channel. Its not necessary to do exclusions here. It seems to me you need to add reflection config for log4j priority.
Seems I fixed logs with
io.pedestal/pedestal.log {:mvn/version "0.5.10"}
org.slf4j/slf4j-simple {:mvn/version "1.7.36"}
org.slf4j/jcl-over-slf4j {:mvn/version "1.7.36"} ;; to bridge commons-logging to logback
metosin/jsonista {:mvn/version "0.3.5"}
software.amazon.awssdk/s3 {:mvn/version "2.24.8" :exclusions [commons-logging/commons-logging]}
software.amazon.awssdk/ses {:mvn/version "2.24.8" :exclusions [commons-logging/commons-logging]}}
Please help tracing exit status 1