You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Trevor Luo [ITSD]" <tr...@vtc.edu.hk> on 2003/04/07 09:14:40 UTC

how to capture the errors in javabean

Hi,

My program has a little bug, I could not found the errors  in all log
files under /usr/local/tomcat/logs.

Can anyone teach me how to capture the errors or possible store it in a
log file. How can i configure it at tomcat or in programming ?  I am
running tomcat 4.1.18 in red hat linux 7.2

Please note the snippet in my java bean.

try {

      System.out.println("Database connection established");
      Context ctx = new InitialContext();
      if(ctx == null )
          throw new Exception("Boom - No Context");

      DataSource ds =
(DataSource)ctx.lookup("java:comp/env/jdbc/DBNewIntra");

      if (ds != null) {
        con = ds.getConnection();
        }
    }catch(Exception e) {
      e.printStackTrace();
    }

Thank you in advance for your help!

Trevor Luo


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org