Mantis - Resin
Viewing Issue Advanced Details
168 minor always 05-13-05 00:00 11-30-05 14:44
camelcai  
 
normal  
closed 3.0.12  
3.0.12 fixed  
none    
none 3.0.14  
0000168: misleading error message when filter class refers to a class not found
RSN-168
When a filter class is referring to another class that cannot be found in CLASSPATH, Resin will complain that the filter class does not have a default constructor with an error message like this:

"[22:45:36.619] com.caucho.config.LineConfigException: WEB-INF/web.xml:108: com.caucho.util.RegistryException: org.jpenguin.security.CheckLoginFilter must have a public zero-arg constructor."

When I insert a printStackTrace in this block:
    try {
      zero = cl.getConstructor(new Class[0]);
      System.out.println ("Constr: " + zero);
    } catch (Throwable e) {
        e.printStackTrace();
    }

We can see the real reason is class not found, from the stack:

java.lang.NoClassDefFoundError: org/apache/regexp/RESyntaxException
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
        at java.lang.Class.getConstructor0(Class.java:2640)
        at java.lang.Class.getConstructor(Class.java:1629)
        at com.caucho.util.BeanUtil.validateClass(BeanUtil.java:548)
        at com.caucho.server.dispatch.FilterConfigImpl.setFilterClass(FilterConfigImpl.java:90)
   .....
Any

Notes
(0000197)
ferg   
05-13-05 00:00   
server/1711