dcsimg
javamail and Tomcat 5.x.x
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   zenovy_shatzov
Posted On:   Monday, December 27, 2004 03:29 PM

I added a javamail session to the global resource configuration as follow: mail.smtp.host smtp.myhost.net mail.debug true I added a resource reference to the web.xml file as follow: mail/Session javax.mail.Session Container using JNDI lookup I am able to retrieve the Session ref: Context nctx = new InitialContext(); session = (Session) nctx.lookup("java:comp/env/mail/Session"); However, when I log the session properties I'm getting session properties: {mail.transport.protocol=smtp, scope=Shareable, auth=Container,   More>>


			
I added a javamail session to the global resource
configuration as follow:



mail.smtp.host
smtp.myhost.net


mail.debug
true



			
I added a resource reference to the web.xml file as follow:


mail/Session
javax.mail.Session
Container






			
using JNDI lookup I am able to retrieve the Session ref:
Context nctx = new InitialContext();
session = (Session) nctx.lookup("java:comp/env/mail/Session");

However, when I log the session properties I'm getting
session properties: {mail.transport.protocol=smtp, scope=Shareable, auth=Container, mail.smtp.host=localhost}

As you can see the mail.smtp.host property is set to the local host not to the smtp.host that i specified in the server.xml configuration file.

Is this a tomcat problem configuration problem?




when I explicitliy setup the properties in my servlet as follow:
session.getProperties().put"mail.smtp.host","smtp.myhost.net");
session.getProperties().put("mail.from", "from");

The servlet works.



Any help is appreciated.    <<Less
About | Sitemap | Contact