Using native image with javax.mail and logback variables #3937
-
Hey there, The first problem is about logback and environment variables. As you can see here, I'm using a variable like this in my <variable name="communicationLogLevel" value="${HTTP_COMMUNICATION_LOG_LEVEL:-INFO}"/> The default value can be overridden in a "regular" docker image, but it doesn't work inside a native image (there is no exception, or anything suspicious, it just always uses the default value). The second problem is about
(The mentioned part of the code in In both cases I've tried to run the native image agent, but I can't get closer to the solution. (I've also attached the output of the agent.) native-image-agent-output-kuvasz.zip Any help appreciated 🙏 Micronaut version: 2.0.1 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hello @adamkobor, regarding the second problem:
You will need to save it to a file, and then use native-image-agent like this: |
Beta Was this translation helpful? Give feedback.
-
@adamkobor regarding the logback issue. Have you tried asking/opening an issue in their tracker? Maybe it's something logback doesn't support yet, but they are not aware. With the email thing, as @fernando-valdez recommended, use the native image tracing agent. More info here: https://medium.com/graalvm/introducing-the-tracing-agent-simplifying-graalvm-native-image-configuration-c3b56c486271 |
Beta Was this translation helpful? Give feedback.
Hello @adamkobor, regarding the second problem:
The error
javax.mail.NoSuchProviderException: smtp
could mean that some JDK classes are not included in the native image by default, and that is intended.We have caller-based filters you can use with the native-image-agent to get the proper configuration files. If you want to know more about this see
https://github.com/oracle/graal/blob/master/substratevm/CONFIGURE.md#caller-based-filters
I would recommend you to initially use this filter:
You will need to save it to a file, and then use native-image-agent like this:
java -agentlib:native-image-agent=config-output-dir=$CONF…