4 Replies Latest reply on Oct 29, 2001 2:06 PM by tbfmicke

    Exception org.apache.jasper.JasperException. Why?

    l.g.

      I'm using JBoss-2.4.1_Tomcat-3.2.3.
      When I throw Exception in JavaBean in JSP I always get org.apache.jasper.JasperException instead of my exception. How to get my Exception?
      TIA.

        • 1. Re: Exception org.apache.jasper.JasperException. Why?
          l.g.

          I post this question a week ago and didn't get any answers. This is look like I cannot use JBoss with Embedded Tomcat, since I cannot provide
          error handling.
          Am I doing something wrong? I don't believe that nobody trying to throw/catch exceptions :)

          • 2. Re: Exception org.apache.jasper.JasperException. Why?
            tbfmicke

            What do you mean with this?

            Where is the exception converted to a JasperException?

            If you throw and exception and does not handle it I guess it would be reasonable to have it converted to a JasperException.

            Or do you mean that
            <%
            try {
            // ...
            myBean.callExceptionMethods(...) ;
            // ...
            } catch (MyException me) {
            // handle
            }
            %>

            Fails to catch your exception?

            • 3. Re: Exception org.apache.jasper.JasperException. Why?
              l.g.

              I have JavaBean (not EJB). I'm using this bean in JSP
              <jsp:useBean id="loader" class="com.rteasset.JspLoader" scope="session"/>.
              If I throw my exception in this bean, the ErrorPage I'm using with my JSP show not the exception I throw but org.apache.jasper.JasperException.

              • 4. Re: Exception org.apache.jasper.JasperException. Why?
                tbfmicke

                Ok, I see what you mean now.

                I assume that your bean throws the exception in its constructor since it occurs during the jsp:useBean.

                You might try to cast the exception in your error page to JasperException (or ServletException) and call getRootCause() on it and see if you get your original exception back. (I think it should work, but has not checked.)

                > I have JavaBean (not EJB). I'm using this bean in
                > JSP
                > <jsp:useBean id="loader"
                > class="com.rteasset.JspLoader" scope="session"/>.
                > If I throw my exception in this bean, the ErrorPage
                > I'm using with my JSP show not the exception I throw
                > but org.apache.jasper.JasperException.