At a guess I would say it is because modules import the META-INF directory by default, while when using jboss-deployment-structure.xml you need to explicitly add meta-inf="true".

Stuart

On Sat, May 21, 2016 at 11:47 PM, Carl Harris <ceharris414@me.com> wrote:
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 -->
                </custom-server>
            </mail-session>


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?

carl




_______________________________________________
wildfly-dev mailing list
wildfly-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/wildfly-dev