Tomcat4.0.3 generates buggy code from JSP?

Discussions

Web tier: servlets, JSP, Web frameworks: Tomcat4.0.3 generates buggy code from JSP?

  1. Tomcat4.0.3 generates buggy code from JSP? (1 messages)

    Hi there,

    I'm trying to get ECperf running on my JBoss3.0.0RC1-Tomcat4.0.3 combo, but it just won't work. I got it to the point where it is deployed properly and without warning. DB access and everything else is up and working. Now, when I test it via the web frontend, it bombs with the following exception:

    <CODE>
    java.lang.InstantiationException :
      class com.sun.ecperf.webbeans.ProcessListBean :
        java.lang.ClassCastException
    </CODE>

    This originates from the following piece of code, which is automatically created by Tomcat out of a JSP:

    <CODE>
                try {
                  processList =
                    (com.sun.ecperf.webbeans.ProcessListBean)
                      java.beans.Beans.instantiate(
                        this.getClass().getClassLoader(),
                        "com.sun.ecperf.webbeans.ProcessListBean"
                      );
                } catch (ClassNotFoundException exc) {
                   throw new InstantiationException(exc.getMessage());
                }
    </CODE>

    The problem seems to be the method call "java.beans.Beans.instantiate(ClassLoader c, String classname)", as processList is of type com.sun.ecperf.webbeans.ProcessListBean. Could it be that the classloader returned by this.getClass().getClassLoader() (where "this" references an instance of a class extending HttpJspBase) can not instantiate any objects of the needed class com.sun.ecperf.webbeans.ProcessListBean?

    And if so: How do I solve this problem? Or is it inside of the code generating methods inside my Tomcat?

    Thanks in advance,
    Lars

    (I GUESS the corresponding JSP tag which is causing this problem is
    <CODE>
    <%@ page language="java" import="com.sun.ecperf.webbeans.*" errorPage="error.jsp" %>
    <jsp:useBean id='processList' scope='session' class='com.sun.ecperf.webbeans.ProcessListBean' />
    </CODE>

    - but I'm not sure.)
  2. Forgot to mention that the same code runs flawlessly with the JBoss2.4.4-Tomcat4.0.1 combination...