Skip to content

Using native image with javax.mail and logback variables #3937

Answered by fernando-valdez
adamkobor asked this question in Q&A
Discussion options

You must be logged in to vote

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:

{
    "rules": [
      {"includeClasses": "javax.mail.**"}
    ]
}

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…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@adamkobor
Comment options

@adamkobor
Comment options

@fernando-valdez
Comment options

@darren7690
Comment options

Answer selected by adamkobor
Comment options

You must be logged in to vote
2 replies
@adamkobor
Comment options

@adamkobor
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants