• Post Reply Bookmark Topic Watch Topic
  • New Topic

javax.servlet. ServletException: javax/ mail/ Authenticator  RSS feed

 
Ellen Zhao
Ranch Hand
Posts: 581
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this in my jsp code:



I put the taglibs-mailer.tld into the right place and after inspecting this file I found the uri above should be correct. I have javamail 1.3 and java beans activation package installed and set classpath properly. But this exception always showed up when I open the jsp file:

exception

javax.servlet.ServletException: javax/mail/Authenticator
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:254)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.NoClassDefFoundError: javax/mail/Authenticator
java.lang.Class.getDeclaredMethods0(Native Method)
java.lang.Class.privateGetDeclaredMethods(Unknown Source)
java.lang.Class.getDeclaredMethods(Unknown Source)....


is it because I didn't set the mail server properly? (I didn't, just entered some value like "asdf") I guess if this is the case, I should get some information like "mail server not available" but why there's something to do with the authenticatior? I am really . Any suggestion or explaination would be highly appreciated.



Regards,
Ellen
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You say you've set the classpath correctly but unfortunately application servers don't typically pay any attention to that. There are standard places that a servlet container, e.g. Tomcat, looks for your class and jar files. Among these are:

It's up to you where you stick the JavaMail JAR(s) but I reckon that should solve your problem.

Jules
[ September 11, 2004: Message edited by: Julian Kennedy ]
 
Ellen Zhao
Ranch Hand
Posts: 581
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Julian,

following your suggestion, I simply pasted mail.jar and activation.jar into the folder mail-app/WEB-INF/lib, rebooted tomcat and reload the page, now the customized error page displaying "Please enter the correct mail server address" appeared. Thank you very much!



Regards,
Ellen
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!