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]



Reply via email to