Mantis - Resin
Viewing Issue Advanced Details
340 minor always 08-09-05 00:00 11-30-05 14:42
user338  
 
high  
closed 2.1.x  
2.1.x fixed  
none    
none 2.1.x  
0000340: MethodExpr.evalObject bug. fixed in 3, please backport.
RSN-384
class implementation visibility causes IllegalAccessException in MethodExpr.evalObject

fix:
in MethodExpr.evalObject
call method.setAccessible(true);
prior to calling
return method.invoke(aObj, objs);

This has been fixed in 3. Please backport.

Note: Using Resin 2.1.x with JDO is nearly impossible as JDO queries returning collections are required to return unmodifiable collections. Using the query results will often cause the following error (or similar).

--------begin test case---------

import com.caucho.el.Expr;
import com.caucho.el.MapVariableResolver;
import com.caucho.jsp.el.JspELParser;

import java.util.HashMap;
import java.util.Collections;
import java.util.HashSet;

public class Test1 {

  public static void main(String[] args) {
    
    try {
      Expr expr = new JspELParser("${c.size()}").parse();
      HashMap map = new HashMap();
      //the implementation of UnmodifiableSet is not public.
      map.put("c", Collections.unmodifiableSet(new HashSet()));
      
      Object o = expr.evalObject(new MapVariableResolver(map));
      System.out.println(o);
      
    } catch (Throwable e) {
      e.printStackTrace(); // todo - fix
    }
  }
}

--------end test case---------
any

There are no notes attached to this issue.