File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please help with setup(JSP,JSTL,JavaMail)

 
Arun Bommannavar
Ranch Hand
Posts: 53
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I like to send e-mail using JSP-JSTTL. Let me first describe the setup and then the error in the JSP page.
I am using Redhat 8.0 box with Tomcat5.0.14,jakarta-taglibs-standard-1.1.0-B1,JavaMail 1.3.1 and JavaBeans Activation Framework 1.0.2. I have copied mail.jar and activation.jar to the lib directory of java installation.
Then I modified the java.sh in /etc/profile.d directory as follows:
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/activation.jar:$JAVA_HOME/lib/mail.jar
When I do echo $CLASSPATH, I do see the whole path correctly.

I have copied taglibs-mailer.tld and to $TOMCAT/webapps/myApp1/WEB-INF and
copied taglibs-mailer.jar to $TOMCAT/webapps/myApp1/WEB-INF/lib directory.
Here is my relevant part of the jsp. I have removed the enclosing brackets

taglib uri="http://jakarta.apache.org/taglibs/mailer-1.1" prefix="mt"
mt:mail server="nameofMyserver" to="myE-mailaddress" from="myEmailaddress" subject="Test mail"
mt:message This is a test /mt:message
mt:send/
/mt:mail


The root cause of the error is as follows:
java.lang.NoClassDefFoundError: javax/mail/Authenticator
Coulod anyone tell me what is the solution? I understand that the .jar files are not being found but when I do echo $CLASSPATH, the jar files are shown correctly.
Thank you.
Arun
 
Joel McNary
Bartender
Posts: 1824
Eclipse IDE Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat ignores the system classpath. You will have to place the activation and mail .jar files in you WEB-INF/lib directory. I don't know Tomcat well enough to say how to make them accessible to all web apps, install them in ${TOMCAT_ROOT}/common/lib.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic