I have a context which includes a mail session. However, when I startup Tomcat (version 5.0.28 on Windows XP) and it loads the context, I get an error message saying:

11:09:53,556 ERROR ContextLoader:177 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mailSession' defined in ServletContext resource [/WEB-INF/classes/cares-batch-context.xml]: Initialization of bean failed; nested exception is javax.naming.NameNotFoundException: Name CARESMailSession
                         is not bound in this Context
javax.naming.NameNotFoundException: Name CARESMailSession
                         is not bound in this Context

However, the context file for this webapp does indeed define a resource named CARESMailSession:

<Context displayName="CARES Batch" docBase="cares-batch" path="/cares-batch" workDir="work\Catalina\localhost\cares-batch">
  <Resource name="CARESMailSession" type="javax.mail.Session"/>
  <ResourceParams name="CARESMailSession">
    <parameter>
      <name>mail.smtp.host</name>
      <value>mail.akc.org</value>
    </parameter>
  </ResourceParams>
</Context>

and the Spring bean is using the proper name:

<bean id="mailSession" class="org.springframework.jndi.JndiObjectFactoryBean">
                <property name="jndiName">
                        <value>java:comp/env/mail/CARESMailSession
                        </value>
                </property>
        </bean>
        

Any help? This has had me down for two days now... :(
--
Darryl L. Pierce <[EMAIL PROTECTED]>
Homepage: http://mcpierce.multiply.com/
"By doubting we come to inquiry, through inquiry truth." - Peter Abelard

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to