Tomcat & JavaMail Help

2006-02-20 Thread nguessan
Hi all,

I am trying to send an email from a servlet. The application is running
on Windows 2003. The servlet compiles but it does not send any email.
My smtp server is configured to properly accept and relay message from
the machine on which my application is running (tested with another
email sending utility). The Tomcat log files do not show anything wrong.
I have an html form that posts the "fromEmail" and "toEmail" to the
FormProcessing servlet. Please find the servlet code below. 

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import javax.naming.*;
import javax.mail.*;
import javax.mail.internet.*;

public class FormProcessor extends HttpServlet{
   public void doPost(HttpServletRequest request, HttpServletResponse
response){
   String fromEmail = request.getParameter("fromEmail");
   String toEmail = request.getParameter("toEmail");
   try{
   Context initCtx = new InitialContext();
   Context envCtx = (Context) initCtx.lookup("java:comp/env");
   Session session = (Session) envCtx.lookup("mail/Session");
   Message message = new MimeMessage(session);
   message.setFrom(new InternetAddress(fromEmail));
   message.addRecipient(Message.RecipientType.TO, new
InternetAddress(toEmail));
   message.setSubject("Hello JavaMail");
   message.setText("NK Welcomes you to JavaMail");
   Transport.send(message);
   }catch(Exception e){
   log("Error in writing response", e);
   }
}
}


Please note that I have added the following xml file

 $CATALINA_HOME/conf/Catalina/localhost/nsb.xml
which contains:

  
  
 
mail.smtp.host
mailgate1.sainc.com
 
  


I have also added the following to the web.xml file


   mail/Session
   javax.mail.Session
   Container



Your help will be greatly appreciated.
Thanks in advance.

N'guessan


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat Administration Package installation

2006-02-24 Thread nguessan
Hi All,

I know that this is a very basic question, but I could not find any
instruction on Tomcat's web site. I have Tomcat 5.5.15 installed on
Windows 2003; it is not bundled with the Tomcat Administration Package
anymore. I have downloaded the Administration Package. It is the
apache-tomcat-5.5.15.zip. In which exact directory should I unbundle
the file? The full path to my Tomcat installation is:
C:\Program Files\Apache Software Foundation\Tomcat 5.5

Thank you in advance for your help.

Nguessan



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat Administration Package installation - Fixed - Thank You

2006-02-24 Thread nguessan
Thanks Mark and Chuck for your help!
Nguessan







>  Original Message 
> Subject: Re: Tomcat Administration Package installation
> From: Mark Thomas <[EMAIL PROTECTED]>
> Date: Fri, February 24, 2006 6:12 pm
> To: Tomcat Users List 
> 
> [EMAIL PROTECTED] wrote:
> > I have downloaded the Administration Package. It is the
> > apache-tomcat-5.5.15.zip. In which exact directory should I unbundle
> > the file?
> 
> C:\Program Files\Apache Software Foundation\Tomcat 5.5
> 
> Mark
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Oracle 10G and JNDI & DataSource - Configuration files

2006-02-27 Thread nguessan
Hi all,

I am trying to connect to an Oracle 10G database, which is located on a
server on the same network. My application and Tomcat 5.5 reside on the
same Windows 2003 machine. Oracle 10G is installed on a separate Windows
2003 machine. The name for the Oracle service is "OracleServicensmsb";
the database to connect is named "msbdb" and resides on the oracle
server, which is called msbdev2; the port is 1521. I am unable to
connect and all my tests point to errors in the configuration files. I
have the following:

In $CATALINA_HOME\conf\server.xml




In $CATALINA_HOME\conf\context.xml

  

In my application's web.xml file, I have:


   jdbc/msbDB
   javax.sql.DataSource
   Container
 

Am I missing something or doing something wrong? Thank you for your
help.

Nguessan


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Configuration files for Tomcat (Oracle, JNDI, & DataSource)

2006-02-27 Thread nguessan
Hi all,
Sorry I had a typo error in my previous email; therefore, I am sending
this one instead.
I am trying to connect to an Oracle 10G database, which is located on a
server on the same network. My application and Tomcat 5.5 reside on the
same Windows 2003 machine. Oracle 10G is installed on a separate Windows
2003 machine. The name for the Oracle service is "OracleServicemsbdb";
the database to connect is named "msbdb" and resides on the oracle
server, which is called msbdev2; the port is 1521. I am unable to
connect and all my tests point to errors in the configuration files. I
have the following:

In $CATALINA_HOME\conf\server.xml




In $CATALINA_HOME\conf\context.xml

 

In my application's web.xml file, I have:


  jdbc/msbDB
  javax.sql.DataSource
  Container


Am I missing something or doing something wrong? Thank you in advance
for your
help.

Nguessan




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Two different version of Tomcat on the same machine?

2006-03-08 Thread nguessan
Hi all,

I have to use tomcat 5.5 for a servlet/JSP application running on
Windows 2003. Apache is the web server and it is listening to port 80.
Another application called Docushare from Xerox has Tomcat 4.1 embedded
and Tomcat 4.1 is listening to port 8080. Will there be an issue if I
install Tomcat 5.5 on the same machine and set it to listen to another
port? In another word, is there a way to configure Apache to use 2
servlet/JSP containers? If yes, is it a stable option?
Thanks,

Nguessan


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]