On 15/12/2014 20:19, Anup Aggarwal wrote:
> Hi,
> 
> I am new to learn the LambdaExpression , and I am trying to run a test with
> JDK7 on Tomcat_8_0_15 server
> 
> protected void doGet... {
>              ELProcessor elp = new ELProcessor();
>             sos.println("Test: " + (LambdaExpression) elp.eval("()->64"));
> }
> 
> But I always get this error
> 
> java.lang.ClassCastException: java.lang.Long incompatible with
> javax.el.LambdaExpression

You are trying to cast the result of the LambaExpression which is a Long
to LambdaExpression which isn't going to work. Just remove the cast.

> I have also tried passing an empty array in the invoke() per the API
> 
> Object[] empty_array = {};
> sos.println("Test: " + ((LambdaExpression)
> elp.eval("()->64")).invoke(empty_array));
> 
> Same Exception,
> java.lang.ClassCastException: java.lang.Long incompatible with
> javax.el.LambdaExpression
> 
> Can someone help and tell me what I am doing wrong.

Same error as above.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to