1 Reply Latest reply on Mar 12, 2002 8:25 PM by Mac Rinehart

    configuration of mail service

    Mac Rinehart Newbie

      Hi,

      I'm running a test on the mail service against JBoss-3.0.0beta2, updated recently from CVS, with my sample application. "Not running," is a more apt description. I have my mail-service.xml setup properly (I'd post it for review, but then you'd get my password!)

      The issue is "javax.naming.NameNotFoundException: Mail not bound." Here's my jndi-name in the mail-service.xml file:


      java:/Mail
      ...


      Here's the jboss.xml file:

      &nbsp &nbsp<enterprise-beans>
      &nbsp &nbsp &nbsp &nbsp<message-driven>
      &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp<ejb-name>GenerateStatementEJB</ejb-name>
      &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp<configuration-name>Standard Message Driven Bean</configuration-name>
      &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp<destination-jndi-name>queue/testQueue</destination-jndi-name>
      &nbsp &nbsp &nbsp &nbsp</message-driven>
      &nbsp &nbsp</enterprise-beans>
      &nbsp &nbsp<resource-managers>

      &nbsp &nbsp &nbsp &nbsp<resource-manager>
      &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp<res-name>mail/MyMail</res-name>
      &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp<res-jndi-name>java:/Mail</res-jndi-name>
      &nbsp &nbsp &nbsp &nbsp</resource-manager>

      &nbsp &nbsp</resource-managers>

      and here is the entry for my ejb that uses the mail service in the ejb-jar.xml file:

      ...
      &nbsp&nbsp&nbsp&nbsp<message-driven>
      &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<![CDATA[This message-driven bean will send email messages.]]>
      &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<ejb-name>GenerateStatementEJB</ejb-name>
      &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<ejb-class>com.sextanttech.messages.GenerateStatementBean</ejb-class>
      &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<transaction-type>Container</transaction-type>
      &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<acknowledge-mode>Auto-acknowledge</acknowledge-mode>
      &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<message-driven-destination>
      &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<destination-type>javax.jms.Queue</destination-type>
      &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</message-driven-destination>
      &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<resource-ref>
      &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<res-ref-name>mail/MyMail</res-ref-name>
      &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<res-type>javax.mail.Session</res-type>
      &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<res-auth>Container</res-auth>
      &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</resource-ref>
      &nbsp&nbsp&nbsp&nbsp</message-driven>
      ...

      any ideas on what the issue is would be greatly appreciated. Thanks, Mac

        • 1. Re: configuration of mail service
          Mac Rinehart Newbie

          Oops. That assessment is wrong. The problem is not with my message driven bean (illustrated in the previous email)but with my client application. It's trying to get the mail Session from the server so it can extract the mail.from address for the purpose of creating some entity beans. (I want to set these beans up so that they get the mail.from address and use it as the mail.to address for the entity that are created, allowing any person to run the example and send messages to themselves after they set up the mail-service.xml file). So, the JNDI name Mail is not bound to the naming context of the client. and for jndi.properties I'm using :

          java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
          java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
          # Do NOT uncomment this line as it causes in VM calls to go over
          # RMI!
          java.naming.provider.url=localhost


          Now that I think about it, allowing the client application to access the Mail properties on the server could be a bit of a problem in most cases. Am I encounter a security issue?

          - Mac