2 Replies Latest reply on Dec 3, 2005 2:48 PM by Scott Stark

    Problems with the JNDI-Lookup to the JavaMail service...

    Markus Mootz Newbie

      Hi Guys,

      might be that a thousand people already have asked but I could not find satisfying help by now so I'm posting my question here, too:

      I am trying to code me a Notifier in one of my java projects and up to now it worked pretty fine. But now that I've begun with the JavaMail stuff it's getting worse...
      My code is (snippet):

      Hashtable props = new Hashtable();
      props.put(Context.INITIAL_CONTEXT_FACTORY, blablabla);
      props.put(Context.PROVIDER_URL, blablabla);
      props.put(Context.URL_PKG_PREFIXES, blablabla);
      InitialContext ictx = new InitialContext(props);
      Session mailSession = (Session) ictx.lookup("java:/Mail");

      And when my JBoss4.0.2 boots up, it reports that
      [MailService] Mail Service bound to java:/Mail

      But when I run my code it says
      javax.naming.NameNotFoundException: Mail not bound

      Anybody got an idea at hand? It starts making me frustrated since I'm trying to fix this for a good two days now...

      Thanks in advance,