[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - Custom error valve

snasto do-not-reply at jboss.com
Tue May 8 12:04:11 EDT 2007


I have used an error report valve in Jboss 3.2.6 and want to make it work on 4.2.0 CR2. 
 I am a beginer in Java and hope for your help.

Here is the problem that I am facing:
compilation error on Throwable
snip code below:

 protected void report(Request request, Response response,
        Throwable throwable)
      throws IOException, ServletException
   {
.............................................................
# later in the code I catch  the error code:

  try
      {
         try
         {
            hres.setContentType("text/html");
            hres.setCharacterEncoding("utf-8");
         }
         catch (Throwable t)
         {
            if (debug >= 1)
               log("status.setContentType", t);
         }



./compile.sh CustomErrorValve.java

CustomErrorValve.java:97: report(org.apache.catalina.connector.Request,org.apache.catalina.connector.Response,java.l
ang.Throwable) in CustomErrorValve cannot override report(org.apache.catalina.connector.Request,org.apache.catalina.
connector.Response,java.lang.Throwable) in org.apache.catalina.valves.ErrorReportValve; overridden method does not t
hrow javax.servlet.ServletException
   protected void report(Request request, Response response,
                  ^
CustomErrorValve.java:371: cannot find symbol
symbol  : method log(java.lang.String,java.lang.Throwable)
location: class CustomErrorValve
               log("status.setContentType", t);
               ^
2 errors 
                    		      


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043973#4043973

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043973



More information about the jboss-user mailing list