I've found that you also need activation.jar for JavaMail, do you have this in 
common/lib too?

Ta
Matt

-----Original Message-----
From: e-Denton Subscriber [mailto:[EMAIL PROTECTED]
Sent: 07 July 2004 15:49
To: Tomcat Users List
Subject: Tomcat 5.0 and JavaMail


I had JavaMail working in Tomcat 4, but in Tomcat 5, I am having trouble. I
know it's something simple, perhaps you can see the problem. Mail.jar is in
Tomcat 5.0\common\lib.

I am getting this error:

"javax.naming.NamingException: Cannot create resource instance:"

Using this context in Tomcat 5.0\conf\Catalina\localhost\e_Denton.xml

"<Context displayName="Portal Application"
         debug="5"
         docBase="e-Denton"
         path="/e-Denton"
         reloadable="true"
         useNaming="true">

    <Loader checkInterval="1" />

 <Resource name="mail/Session" auth="Container" type="javax.mail.Session" />
 <ResourceParams name="mail/Session">
  <parameter>
   <name>mail.smtp.host</name>
   <value>mars.webappcabaret.net</value>
  </parameter>
 </ResourceParams>
..."

And this web.xml:

"<!-- JavaMail Resource -->
 <resource-ref>
  <description>
  Resource reference to a factory for javax.mail.Session
  preconfigured to connect to the appropriate SMTP server.
  </description>
  <res-ref-name>mail/Session</res-ref-name>
  <res-type>javax.mail.Session</res-type>
  <res-auth>Container</res-auth>
 </resource-ref>"

Accessed like this:

  "try
   {
   Context initContext = new InitialContext();
   Context envContext  = (Context) initContext.lookup("java:comp/env");
   Session session = (Session) envContext.lookup("mail/Session");
   }
  catch (javax.naming.NamingException ne)"






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

Any opinions expressed in this E-mail may be those of the individual and not 
necessarily the company. This E-mail and any files transmitted with it are 
confidential and solely for the use of the intended recipient. If you are not the 
intended recipient or the person responsible for delivering to the intended recipient, 
be advised that you have received this E-mail in error and that any use or copying is 
strictly prohibited. If you have received this E-mail in error please notify the 
beCogent postmaster at [EMAIL PROTECTED]
Unless expressly stated, opinions in this email are those of the individual sender and 
not beCogent Ltd. You must take full responsibility for virus checking this email and 
any attachments.
Please note that the content of this email or any of its attachments may contain data 
that falls within the scope of the Data Protection Acts and that you must ensure that 
any handling or processing of such data by you is fully compliant with the terms and 
provisions of the Data Protection Act 1984 and 1998.


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

Reply via email to