Hello,
I would like to deploy a Spring MVC application that I developed as the ROOT
application on Tomcat. I also configured the Tomcat server to run on port
80. My Spring application has JNDI references to Java mail sessions. I am
unable to figure out how to get this configured. Here is what I did:
_ In the server.xml file, I created a special <Context> element under the
<Host> element. I added a <Resource> element for the mail server inside
this.
<Context path="/ROOT" docBase="ROOT" debug="5" reloadable="true"
crossContext="true">
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session" mail.smtp.host="localhost"/>
</Context>
But I get this following error message when the application starts:
Jun 1, 2009 6:34:53 PM org.springframework.web.context.ContextLoader
initWebApplicationContext
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'mailSession' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested
exception is javax.naming.NameNotFoundException: Name mail is not bound in
this Context
Any suggestions on how to attach JNDI resources for Default web application
for Tomcat.
Thanks.