[wildfly-dev] JavaMail provider module and jboss-deployment-structure.xml

Carl Harris ceharris414 at me.com
Sat May 21 09:47:38 EDT 2016

I have a custom JavaMail provider installed as a module in Wildfly 10.

In the configuration, I specify a mail session using the custom provider like this:

            <mail-session name="rcpt" jndi-name="FixedRecipient">
                <custom-server name="FixedRecipient">
                   <!-- configuration properties hee -->

If I make the provider a global module in the configuration, a deployment can successfully use the provider. 

However, if I specify the provider as module dependency in jboss-deployment-structure.xml, when trying to create a javax.mail.Session using the provider, a NoSuchProviderException is thrown (as though the base Session implementation cannot find a META-INF/javamail.providers mapping that identifies the custom provider).

I don't know whether specifying the provider as a deployment structure dependency should work or not, but it seems like it should.

Can someone please explain?


More information about the wildfly-dev mailing list