remm        2003/08/09 06:08:18

  Modified:    jasper2/src/share/org/apache/jasper JspC.java
  Log:
  - Display root cause for build errors.
  - Fix classpath generation (the side effect seems needed when compiling tag
    files, somehow).
  
  Revision  Changes    Path
  1.52      +39 -4     
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java
  
  Index: JspC.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- JspC.java 7 Aug 2003 18:14:35 -0000       1.51
  +++ JspC.java 9 Aug 2003 13:08:18 -0000       1.52
  @@ -68,6 +68,8 @@
   import javax.xml.parsers.DocumentBuilder;
   import javax.xml.parsers.DocumentBuilderFactory;
   
  +import javax.servlet.ServletException;
  +
   import org.w3c.dom.Node;
   import org.w3c.dom.NodeList;
   import org.w3c.dom.Element;
  @@ -730,6 +732,24 @@
                                              fne.getMessage()));
            }
               throw new JasperException( fne );
  +        } catch (ServletException e) {
  +            Throwable rootCause = e;
  +            Throwable rootCauseCheck = null;
  +            // Extra aggressive rootCause finding
  +            do {
  +                if (rootCause instanceof ServletException) {
  +                    rootCauseCheck = 
  +                        ((ServletException) rootCause).getRootCause();
  +                    if (rootCauseCheck != null) {
  +                        rootCause = rootCauseCheck;
  +                        rootCauseCheck = null;
  +                    }
  +                }
  +            } while (rootCauseCheck != null);
  +            log.error(Localizer.getMessage("jspc.error.generalException",
  +                                        file),
  +                   rootCause);
  +            return false;
           } catch (Exception e) {
               log.error(Localizer.getMessage("jspc.error.generalException",
                                           file),
  @@ -856,6 +876,21 @@
                   mergeIntoWebXml();
               }
   
  +        } catch (ServletException e) {
  +            Throwable rootCause = e;
  +            Throwable rootCauseCheck = null;
  +            // Extra aggressive rootCause finding
  +            do {
  +                if (rootCause instanceof ServletException) {
  +                    rootCauseCheck = 
  +                        ((ServletException) rootCause).getRootCause();
  +                    if (rootCauseCheck != null) {
  +                        rootCause = rootCauseCheck;
  +                        rootCauseCheck = null;
  +                    }
  +                }
  +            } while (rootCauseCheck != null);
  +            rootCause.printStackTrace();
           } catch (Throwable t) {
               t.printStackTrace();
           }
  @@ -942,7 +977,7 @@
       private void initClassLoader(JspCompilationContext clctxt)
            throws IOException {
   
  -        String classPath = getClassPath();
  +        classPath = getClassPath();
   
           ClassLoader jspcLoader = getClass().getClassLoader();
           if (jspcLoader instanceof AntClassLoader) {
  
  
  

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

Reply via email to