1 Reply Latest reply on Aug 20, 2008 2:27 PM by g king

    JavaMail JNDI Problem

    g king Newbie

      I am trying to setup the example jar from javamail1.4 within JBoss, but, I keep having problems linking my war to the appropriate JNDI value or setting the JNDI resource explicitly. I'm using JBoss4.0.3RC1

      The following is the error:

       ... 62 more
      10:39:12,031 ERROR [MainDeployer] Could not start deployment: file:/C:/jboss-4.0
      org.jboss.deployment.DeploymentException: Error during deploy; - nested throwabl
      e: (javax.naming.NamingException: resource-ref: MySession has no valid JNDI bind
      ing. Check the jboss-web/resource-ref.)

      I'm not sure what is meant by the jboss-web/resource-ref. I've taken a guess that it means a jboss-web.xml file, but, then again, I'm not sure which jboss-web.xml file I'm supposed edit.


       <mbean code="org.jboss.mail.MailService"
       <attribute name="JNDIName">java:/NetaMail</attribute>
       <attribute name="User">###</attribute>
       <attribute name="Password">###</attribute>
       <attribute name="Configuration">
       <!-- Test -->
       <!-- Change to your mail server prototocol -->
       <property name="mail.store.protocol" value="imap"/>
       <property name="mail.transport.protocol" value="smtp"/>
       <!-- Change to the user who will receive mail -->
       <property name="mail.user" value="###"/>
       <!-- Change to the mail server -->
       <property name="mail.pop3.host" value="###"/>
       <!-- Change to the SMTP gateway server -->
       <property name="mail.smtp.host" value="###"/>
       <!-- Change to the address mail will be from -->
       <property name="mail.from" value="neta@###.com"/>
       <!-- Enable debugging output from the javamail classes -->
       <property name="mail.debug" value="true"/>

      and I tried the server/default/deploy/jmx-console.war/WEB-INF/jboss-web.xml
      but to no avail:

      Can anyone tell me where I'm messing up?


        • 1. Re: JavaMail JNDI Problem
          g king Newbie

          Well a little more snooping payed off....

          I noticed on startup the jmx console deployment was throwing an error about finding my entry into the jboss-web.xml and not finding it in the web.xml. So that got me thinking that perhaps this war file needs a jboss-web.xml and indeed it did.

           |- web.xml
           |- jboss-web.xml

          Both contain:

          And alls well that ends well...