Forums Register Login

com.sun.mail.util.MailLogger

+Pie Number of slices to send: Send
friends i am having this error Help me to rectify it.

am using all jar files correctly

java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger

<%
String emailid = "xxxxxxxx";
String key = "bfskjbfskjdbnf";
String host = "smtp.gmail.com";
final String from = "xxxxxxx";
final String psd = "xxxxxxx";
String sub = "Sending Password";
String body = "Thank you for Register"
+ " Userid = "+emailid +" and Password = "+key;
// Properties props = System.getProperties();
Properties props= new Properties();
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.socketFactory.port", "465");
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.port", "465");


Session mailSession = Session.getInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(from, psd);
}
});

mailSession.setDebug(true);
Message msg = new MimeMessage(mailSession);
//Message msg = new MimeMessage(mailSession);
try{
msg.setFrom(new InternetAddress(from));
InternetAddress add[] = {new InternetAddress(emailid)};
msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(emailid));
msg.setSubject(sub);
msg.setText(body);
Transport.send(msg);
System.out.println("send success!");

}
catch(MessagingException ex)
{
ex.printStackTrace();
}
//Transport trans = session.getTransport("smtp");
//Transport.send(msg);
//Transport.send(msg);
//ending sending mail code





%>
+Pie Number of slices to send: Send
 

am using all jar files correctly


Apparently not.

java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger


Where is the jar file that contains this class?
+Pie Number of slices to send: Send
As I explained in your previous thread you cannot easily debut code while it is the middle of a JSP. You need to extract it into a class separate from the JSP then it can be tested and debugged with a simple main program ind invoked from the JSP when it has been debugged.

P.S. Why have you posted this in the Security forum?
+Pie Number of slices to send: Send
This is my error


SEVERE: Servlet.service() for servlet [jsp] in context with path [/LifecareHospital] threw exception [javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger] with root cause
java.lang.ClassNotFoundException: com.sun.mail.util.MailLogger
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1713)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
at javax.mail.Session.initLogger(Session.java:221)
at javax.mail.Session.<init>(Session.java:206)
at javax.mail.Session.getInstance(Session.java:242)
at org.apache.jsp.sendmail_jsp._jspService(sendmail_jsp.java:116)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
+Pie Number of slices to send: Send
Friends dont get anger on me really i dont know your questions pl tell me briefly what i have to do
+Pie Number of slices to send: Send
You have received several messages (see the "My Purple Mooseages" link above), you now need to do what they tell you instead of ignoring them. Do not post again before you follow the latest one, or your account will be closed permanently.
+Pie Number of slices to send: Send
 

Ulf Dittmer wrote:

java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger


Where is the jar file that contains this class?

 
Look! It's Leonardo da Vinci! And he brought a tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 6540 times.
Similar Threads
StackOverflowError
How to send mail form java application
java mail
Mail send in struts
how to send a mail to yahoo user
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:18:40.