You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Bob Jamison <rj...@lincom-asg.com> on 2000/10/13 17:07:07 UTC

Re: Q for tc4: now its running


Bob Jamison wrote:

> Never mind.  It's in /bin.  Need sleep!
>
> Bob

In a 'pristine' /dist copy, not modified, running
any 'example' servlet  produces a ClassCastEx when setting
a new filter via newInstance():

java.lang.ClassCastException: filters.ExampleFilter
        at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:339,
Compiled Code)
        at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:117,
Compiled Code)

...etc....



Here is the offending code:

     if (filterClass.startsWith("org.apache.catalina."))
  classLoader = this.getClass().getClassLoader();
     else
  classLoader = context.getLoader().getClassLoader();

     // Instantiate a new instance of this filter
     Class clazz = classLoader.loadClass(filterClass);
     this.filter = (Filter) clazz.newInstance();    <--line 339
     filter.setFilterConfig(this);

I'm trying to run this thing via a debugger, so I can see what
filterClass can be....


Bob