2 Replies Latest reply on Apr 24, 2002 11:25 AM by John Baker

    Mail Access From WebApp Tomcat3.2.3/Jboss2.4.4

    John Baker Newbie

      I have a problem looking up a javax.mail.Session from within a web application deployed to tomcat via jboss. My EJBs don't have any trouble with the mail configuration. I am attempting to use the same lookup copied from my EJBs i.e session = (Session)getContext().lookup("java:comp/env/mail/DefaultMail");

      Is there something special I have missed that needs to be configured for this to work inside tomcat? I have been using running with default tomcat config.

      com.katalyzt.toolbox.websetup.MailException: Could not send mail
      Nested Exception: com.katalyzt.toolbox.websetup.MailException: Could not retrieve mail session
      Nested Exception: javax.naming.NameNotFoundException: mail not bound
      at com.katalyzt.toolbox.websetup.RegisterAction.sendActivationMail(RegisterAction.java:97)
      at com.katalyzt.toolbox.websetup.RegisterAction.perform(RegisterAction.java:65)
      at com.softcomms.webcontrol.Controller.service(Controller.java:75)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
      at org.apache.tomcat.core.Handler.service(Handler.java:287)
      at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
      at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
      at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
      at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
      at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
      at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
      at java.lang.Thread.run(Unknown Source)

        • 1. Naming Conflict?
          John Baker Newbie

          I found I had missed a resource reference. However, there is still a problem. What am I doing wrong?

          com.katalyzt.toolbox.websetup.MailException: Could not send mail
          Nested Exception: com.katalyzt.toolbox.websetup.MailException: Could not retrieve mail session
          Nested Exception: javax.naming.NamingException: Could not dereference object [Root exception is java.lang.NullPointerException]
          at com.katalyzt.toolbox.websetup.RegisterAction.sendActivationMail(RegisterAction. java:89)
          at com.katalyzt.toolbox.websetup.RegisterAction.perform(RegisterAction.java:57)
          at com.softcomms.webcontrol.Controller.service(Controller.java:75)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
          at org.apache.tomcat.core.Handler.service(Handler.java:287)
          at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
          at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
          at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
          at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConn ectionHandler.java:213)
          at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
          at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
          at java.lang.Thread.run(Unknown Source)

          • 2. Re: Mail Access From WebApp Tomcat3.2.3/Jboss2.4.4
            John Baker Newbie

            I actually put too much in the deployment descriptor. I don't have this problem anymore.

            However, It's probably a good idea for someone to check this out as a NullPointerException shouldn't really occurr in a well formed app just because I have added an unnecessary entry.