0

I have followed the JBoss Web - JNDI Resources HOW-TO, but am still getting a no valid JNDI binding error on mail/Session. Here are the entries in the associated files. web app name is goDog. jboss-web.xml:

 <jboss-web>
          <context-root>goDog</context-root>
    </jboss-web>

WEB-INF/web.xml snippet:

<resource-ref>
        <description>
            Resource reference to a factory for javax.mail.Session
            instances that may be used for sending electronic mail
            messages, preconfigured to connect to the appropriate
            SMTP server.
        </description>
        <res-ref-name>
            mail/Session
        </res-ref-name>
        <res-type>
            javax.mail.Session
        </res-type>
        <res-auth>
            Container
        </res-auth>
    </resource-ref>

META-INF/context.xml:

 <?xml version="1.0" encoding="UTF-8"?>
   <Context>
   <Resource name="mail/Session" auth="Container" type="javax.mail.Session" mail.smtp.host="<themailserver>" />        
   </Context>

I appreciate any guidance. last burr stuck on my sock for successful deployment.

Zombo99
  • 1
  • 2

1 Answers1

0

I have determined the resolution for JBoss (4.2, yea, I know, very old) JNDI Mail resource configuration. Below is the resolution. 1. a resource-ref(erence) entry in \WEB-INF/web.xml:

<resource-ref>
        <description>
            Resource reference to a factory for javax.mail.Session
            instances that may be used for sending electronic mail
            messages, preconfigured to connect to the appropriate
            SMTP server.
        </description>
        <res-ref-name>mail/Session</res-ref-name>
        <res-type>javax.mail.Session</res-type>
        <res-auth>Container</res-auth>
</resource-ref>
  1. an entry in the JBoss intermediary file \WEB-INF/jboss-web.xml to connect the web.xml resource-ref(erence) to the JNDI JBoss Mail service:

    mail/Session java:/Mail

  2. an update in JBoss Mail Resource file server\\deploy\mail_service.xml (mail.smtp.host property):

    java:/Mail nobody password jboss:service=Naming

Zombo99
  • 1
  • 2