Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Struts - A MVC web framework
Tomcat - JSP/Servlet container
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
JSP - A mailing list about Java Server Pages specification and reference
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
Javamail not working with non-Outlook Express users.

Javamail not working with non-Outlook Express users.

2004-01-14       - By charles doweary

 Back
Reply:     1     2     3     4     5     6     7     8  

System setup:  Windows Server 2003, Tomcat5.0.16, and IIS6.0.

My mail server sends email messages successfully when the user has Outlook
Express set up on their desktop, but non-Outlook Express users get the
following servlet error messages:

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 Source code of javax.servlet.ServletException

org.apache.jasper.runtime.PageContextImpl Source code of org.apache.jasper.runtime.PageContextImpl(PageContextImpl
.java:867)
org.apache.jasper.runtime.PageContextImpl Source code of org.apache.jasper.runtime.PageContextImpl(PageContextImpl
.java:800)
org.apache.jsp.jsp.authorizePurchase_jsp._jspService(authorizePurchase_jsp.java
:204)
org.apache.jasper.runtime.HttpJspBase Source code of org.apache.jasper.runtime.HttpJspBase(HttpJspBase.java:133)
            javax.servlet.http.HttpServlet Source code of javax.servlet.http.HttpServlet(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper Source code of org.apache.jasper.servlet.JspServletWrapper(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet Source code of org.apache.jasper.servlet.JspServlet(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet Source code of org.apache.jasper.servlet.JspServlet(JspServlet.java:248)
            javax.servlet.http.HttpServlet Source code of javax.servlet.http.HttpServlet(HttpServlet.java:856)

root cause
com.generic.exceptions.CustomerActivityException
            com.generic.product.Order.recordOrder(Unknown Source)

org.apache.jsp.jsp.authorizePurchase_jsp._jspService(authorizePurchase_jsp.java
:151)
org.apache.jasper.runtime.HttpJspBase Source code of org.apache.jasper.runtime.HttpJspBase(HttpJspBase.java:133)
            javax.servlet.http.HttpServlet Source code of javax.servlet.http.HttpServlet(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper Source code of org.apache.jasper.servlet.JspServletWrapper(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet Source code of org.apache.jasper.servlet.JspServlet(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet Source code of org.apache.jasper.servlet.JspServlet(JspServlet.java:248)
            javax.servlet.http.HttpServlet Source code of javax.servlet.http.HttpServlet(HttpServlet.java:856)

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

Apache Tomcat/5.0.16

Here is a copy of the source code that is used to send the email message:

package com.generic.product;

import java.util.Vector Source code of java.util.Vector;
import java.util.HashMap Source code of java.util.HashMap;
import java.util.Iterator Source code of java.util.Iterator;
import java.util.Properties Source code of java.util.Properties;
import java.text.NumberFormat Source code of java.text.NumberFormat;
import java.sql.*;
import org.apache.log4j.Category Source code of org.apache.log4j.Category;
import org.apache.turbine.services.db.TurbineDB Source code of org.apache.turbine.services.db.TurbineDB;
import org.apache.turbine.util.db.pool.DBConnection;
import com.generic.product.Product;
import java.util.ResourceBundle Source code of java.util.ResourceBundle;
import com.generic.customer.*;
import com.generic.product.*;
import com.generic.exceptions.*;
import com.generic.cart.*;
import javax.naming.NamingException Source code of javax.naming.NamingException;
import javax.naming.Context Source code of javax.naming.Context;
import javax.naming.InitialContext Source code of javax.naming.InitialContext;
import javax.naming.NamingEnumeration Source code of javax.naming.NamingEnumeration;
import javax.naming.directory.InitialDirContext Source code of javax.naming.directory.InitialDirContext;
import javax.mail.internet.InternetAddress Source code of javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage Source code of javax.mail.internet.MimeMessage;
import javax.mail.internet.AddressException Source code of javax.mail.internet.AddressException;
import javax.mail.Message Source code of javax.mail.Message;
import javax.mail.Session Source code of javax.mail.Session;
import javax.mail.MessagingException Source code of javax.mail.MessagingException;
import javax.mail.Transport Source code of javax.mail.Transport;
import javax.servlet.http.*;
import com.braju.format.*;

public class Order {
   private static ResourceBundle sql_bundle =
  ResourceBundle.getBundle("com.generic.product.SQLQueries");

   private static ResourceBundle email_bundle =
  ResourceBundle.getBundle("com.generic.emailProperties");

/**
    * Mails a receipt for the order to the customer.
    *
    * @(protected) email The address to mail the receipt to.
    **/

   public void emailReceipt(String email)
  throws NamingException, AddressException, MessagingException {
  Properties props = new Properties();
               props.put("smtp.covad.net", "XXXXXX-YYYYYY1");
  Session session = Session.getDefaultInstance(props, null);

  Message message = new MimeMessage(session);
  message.setFrom(new InternetAddress(email_bundle.getString("fromAddr")));
  InternetAddress to[] = new InternetAddress[1];
  to[0] = new InternetAddress(email);
  message.setRecipients(Message.RecipientType.TO, to);
  message.setSubject("Receipt for order " + getOrderNumber());
  StringBuffer contents = new StringBuffer();
  contents.append("Thank you for shopping at Generic Books.\n\n");
  contents.append("Here is the receipt for your order " + getOrderNumber() +
      " placed on " + getOrderDate() + "\n\n");
  contents.append("CODE        TITLE                           QUANT  PRICE  
TOTAL\n");
  contents.append("=============================================================
===\n");
  Iterator items = getItems().iterator();
  while (items.hasNext()) {
     CartItem it = (CartItem) items.next();
     Parameters p = new Parameters();
     p.add(it.getProduct().getPRODUCT_ID());
     p.add(it.getProduct().getTitle());
     p.add(it.getQuantity());
     p.add(it.getProduct().getPrice());
     p.add(it.getLineItemPrice());
     contents.append(Format.sprintf("%-10.10s  %-30.30s  %2d     $%5.2f
$%5.2f\n", p));
  }
  message.setContent(contents.toString(), "text/plain");
  Transport.send(message);
   }

}

Questions:

  1.  My mail server permits messages to be relayed, and the email messages
do work with Outlook Express.  What do I need to add/change in the above
code to get the messaging to work in all cases?

  2.   Does JavaMail only work with Outlook Express?

  3.   Is there some additional software that I need to be using to get
JavaMail to work in all cases?

Please advise,
Thanks

__ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ __
Get a FREE online virus check for your PC here, from McAfee.
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)




©2008 junlu.com - Jax Systems, LLC, U.S.A.