Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Please help with setup(JSP,JSTL,JavaMail)  RSS feed

Arun Bommannavar
Ranch Hand
Posts: 53
  • 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 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="" prefix="mt"
mt:mail server="nameofMyserver" to="myE-mailaddress" from="myEmailaddress" subject="Test mail"
mt:message This is a test /mt:message

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.
Joel McNary
Posts: 1840
Eclipse IDE Java Ruby
  • 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
Boost this thread!