2 Replies Latest reply on Dec 17, 2008 8:00 PM by Zarar Siddiqi

    JNDI lookup for mail Session on Glassfish

    Zarar Siddiqi Newbie
      I'm trying to configure my app to make a JNDI lookup in Glassfish when using Seam's mail component and I keep getting the following exception:

      java.lang.ClassCastException: com.sun.enterprise.deployment.MailConfiguration cannot be cast to javax.mail.Session

      My configuration is as simple as this:

      |<mail:mail-session session-jndi-name="mail/local" />|

      And I have created a |mail/local| resource under JavaMail Sessions in the Glassfish console.

      If I use a Seam configured mail session using the following, it works fine:

      |<mail:mail-session host="postoffice139.utcc.utoronto.ca"/>|

      Any ideas what's wrong? I'm a little confused because the JNDI lookup is succeeding, it's just returning the wrong type of object.  It's not like I"m getting a NameNotFoundException when doing the JNDI lookup.  Is my |<mail:mail-session> configuration correct>|