aspose file tools*
The moose likes JSP and the fly likes getting error javax.servlet.ServletException: javax/mail/Message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "getting error javax.servlet.ServletException: javax/mail/Message" Watch "getting error javax.servlet.ServletException: javax/mail/Message" New topic
Author

getting error javax.servlet.ServletException: javax/mail/Message

Usman Saeed
Ranch Hand

Joined: May 21, 2008
Posts: 34
hello
i am using tomcat 5.5 and application is in simple jsp. following error occur. i've mail.jar file in WEB-INF/lib folder. It is working fine on JRun server but when i changed server to tomcat 5.5 it started giving following error on some pages.



HTTP Status 500 -

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

type Exception report

message

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

exception

javax.servlet.ServletException: javax/mail/Message
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)


root cause

java.lang.NoClassDefFoundError: javax/mail/Message
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
java.lang.Class.getConstructor0(Class.java:2699)
java.lang.Class.getConstructor(Class.java:1657)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1194)
org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1117)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2166)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2216)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2222)
org.apache.jasper.compiler.Node$Root.accept(Node.java:457)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2166)
org.apache.jasper.compiler.Generator.generate(Generator.java:3384)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:220)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:317)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:565)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:309)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)


root cause

java.lang.ClassNotFoundException: javax.mail.Message
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1438)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1284)
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
java.lang.Class.getConstructor0(Class.java:2699)
java.lang.Class.getConstructor(Class.java:1657)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1194)
org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1117)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2166)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2216)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2222)
org.apache.jasper.compiler.Node$Root.accept(Node.java:457)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2166)
org.apache.jasper.compiler.Generator.generate(Generator.java:3384)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:220)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:317)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:565)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:309)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)


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



Usman Saeed
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61661
    
  67

WEB-INF/lib not web-inf/lib

Also, red text on tan is not very readable. Suggest you rethink that one.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Usman Saeed
Ranch Hand

Joined: May 21, 2008
Posts: 34
thank you for reply,
it is WEB-INF/lib. by mistake i wrote web-inf/lib here.
as i told same application was running fine on JRun but its not working on tomcat 5.5
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Usman Saeed wrote:thank you for reply,
it is WEB-INF/lib. by mistake i wrote web-inf/lib here.
as i told same application was running fine on JRun but its not working on tomcat 5.5


Include mail.jar and activation.jar in the classpath


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Usman Saeed
Ranch Hand

Joined: May 21, 2008
Posts: 34
My mistake.
thanks both of you for your replies.
accidentally i uploaded mail.jar file on some other application's WEB-INF/lib folder. now every thing is fine.
 
 
subject: getting error javax.servlet.ServletException: javax/mail/Message