This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Properties not properly set in tomcat mail session.

 
Anders Lunden
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I have an anoying problem with tomcat and the use of mail sessions.

I've created a test servlet (MyServlet) in my attempts to narrow down the problem. The problem is that the mail session gotten from the jndi-lookup doesn't get the properties I've set in the server.xml.

Here's my MyServlet:



The output I get when starting the Tomcat server is:



First of all the init()-method seems to be run twice. Which I guess is ok since tomcat is the servlet container and can create as many instances of the servlet it wants. But the second time around the mail session doesn't get the properties I have configured in server.xml. You see that the javax.mail.Session instances are not the same in the two runs. All subsequent lookups for mail/Sesssion retrieves the Session-instance with the wrong (javax.mail.Session@1c1c92b) configuration, hence my application won't be able to use the session to send emails.
Any help to understand/solve this problem is very appreciated.

Here's the relevent stuff from my server.xml:


And here's the resource-ref in the web.xml:



Cheers
/Anders
[ November 06, 2008: Message edited by: Anders Lund´┐Żn ]
 
Anders Lunden
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I forgot to mention that I'm using Tomcat 5.5.17.

/Anders
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic