File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes Mails thru JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Mails thru JSP" Watch "Mails thru JSP" New topic
Author

Mails thru JSP

Megha Rajeevan
Greenhorn

Joined: Mar 22, 2006
Posts: 24
Hello Ranchers.
I'm doing a project in JSP and oracle.. In a particular module i've send an email regarding the fault management..
The code i've done is here
---------------------------------------------------------------------------

<html>
<%@ taglib uri="http://jakarta.apache.org/taglibs/mailer-1.1" prefix="mt" %>
<%@ page session="false" %>
<head>
<title>Example JSP using mailer taglib</title>
</head>
<body bgcolor="#FFFFFF">
<!-- The server, session, or mimeMessage attributes are not required -->
<!-- the mail server used will be localhost. -->
<mt:mail to="meg.rajeev@gmail.com" from="meg.rajeev@test.com" subject="test">
<mt:message>Hi---------this is a test email</mt:message>
<mt:send/n>
</mt:mail>
</body>
</html>

---------------------------------------------------------------------------
i've downloaded the taglib from Apache tomcat site and copied to WEB-INF folder.. the jar file i copied to /WEB-INF/lib folder and the tdl i copied to the /WEB-INF
in the web.xml file i edited the following things
---------------------------------------------------------------------------

<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/mailer-1.1</taglib-uri>
<taglib-location>/WEB-INF/taglibs-mailer.tld</taglib-location>
</taglib>
</web-app>

---------------------------------------------------------------------------

this is showing the runtime error
the error is this
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

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

root cause

java.lang.NoClassDefFoundError: javax/mail/Authenticator
java.lang.Class.getDeclaredMethods0(Native Method)
java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
java.lang.Class.getDeclaredMethods(Class.java:1763)
java.beans.Introspector$1.run(Introspector.java:1265)
java.security.AccessController.doPrivileged(Native Method)
java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1263)
java.beans.Introspector.getTargetMethodInfo(Introspector.java:1129)
java.beans.Introspector.getBeanInfo(Introspector.java:387)
java.beans.Introspector.getBeanInfo(Introspector.java:159)
org.apache.jasper.compiler.Generator$TagHandlerInfo.<init>(Generator.java:3667)
org.apache.jasper.compiler.Generator$GenerateVisitor.getTagHandlerInfo(Generator.java:2092)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1598)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1458)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2180)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2230)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2236)
org.apache.jasper.compiler.Node$Root.accept(Node.java:485)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2180)
org.apache.jasper.compiler.Generator.generate(Generator.java:3255)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

note The full stack trace of the root cause is available in the Tomcat logs.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

How can i fix this problem.. please help me ranchers..

thanks in advance!!

regards

Megha Rajeev
magesh karnam
Greenhorn

Joined: Sep 08, 2003
Posts: 14
Hi

Did u add the mail.jar and activation.jar in ur application if so then remove it.

Make sure that activation.jar and mail.jar are only in $TOMCAT_HOME/common/lib.

These jar files must not be present in the WEB-INF/lib, or things won't work

regards
magesh karnam
Greenhorn

Joined: Sep 08, 2003
Posts: 14
Hi

Did u add the mail.jar and activation.jar in ur application if so then remove it.

Make sure that activation.jar and mail.jar are only in $TOMCAT_HOME/common/lib.

These jar files must not be present in the WEB-INF/lib, or things won't work

regards
Magesh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mails thru JSP
 
Similar Threads
custom tag doubt
Tag files
ServletException: UnhandledException
Struts1 - tiles -cascading tiles:insert
Simple Jsp-Bean problem !!