Yeah .. sure thanks..

On 23 Apr 2004, at 21:24, Filip Hanik ((lists)) wrote:

javax.activation in both by webapp lib directory and common/lib

don't put the same class file in two different locations to be loaded by two
different classloaders.
remove it from webapp/lib and keep it only in common/lib, and try again


filip
-----Original Message-----
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Friday, April 23, 2004 10:42 AM
To: Tomcat Users List
Subject: TC5 java mail woes


Hello


After posting this problem yesterday I went away and assumed that the
problem must be the consequence of my IQ deficit and/or all crack
smoking..

Before I start , yes I have the java mail 1.31 and a recent copy of
javax.activation  in both by webapp lib directory and common/lib

I added the context in the relevant place in sever.xml

<Context path="/acme-mail" docBase="acme-mail" debug="9"
                  reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
                      prefix="acme-mail." suffix=".log"
                  timestamp="true"/>

<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"/>
   <ResourceParams name="mail/Session">
     <parameter>
       <name>mail.smtp.host</name>
       <value>out.aliceposta.it</value>
     </parameter>
   </ResourceParams>
</Context>

i also tried

<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"/>
   <ResourceParams name="mail/Session">
     <parameter>
       <name>mail.smtp.host</name>
       <value>out.aliceposta.it</value>
     </parameter>
   </ResourceParams>

nested in  <GlobalNamingResources> because it seemed a really cool
thing to do at the time and i wanted to impress my friends.

in acme-mail (the webapp) web.xml

<resource-ref>
   <description></description>
   <res-ref-name>mail/Session</res-ref-name>
   <res-type>javax.mail.Session</res-type>
   <res-auth>Container</res-auth>
</resource-ref>

after the taglib declarations as specified by the dtd
http://java.sun.com/j2ee/dtds/web-app_2_2.dtd

when i try to grab the mail session i get this..

java.lang.NoClassDefFoundError: javax/activation/DataSource

point to the line where i try and feed session to the mime message
constructor.

Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
Session mailSession = (Session) envCtx.lookup("mail/Session");
Message msg = new MimeMessage(mailSession);

Has no body had this problem?

Mark


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.665 / Virus Database: 428 - Release Date: 4/21/2004

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.665 / Virus Database: 428 - Release Date: 4/21/2004


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



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



Reply via email to