struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Breaux <bre...@us.ibm.com>
Subject Re: s:fielderror not working in Java 8, WebSphere
Date Wed, 23 May 2018 19:48:56 GMT


On 2018/05/23 19:30:40, Yasser Zamani <yasserzamani@apache.org> wrote: 
> 
> Thanks. Sorry, for last one, could you check:
> 
>         java.util.Map lhm = new java.util.LinkedHashMap<>();
>         Class<?> c = lhm.getClass();
>         java.lang.reflect.Method m = c.getMethod("keySet");
>         Object ks = m.invoke(lhm);
>         Class<?> c2 = ks.getClass();
>         java.lang.reflect.Method m2 = c2.getMethod("size");
>         System.out.println("COPY ME 1: " + m2);
>         Object s = m2.invoke(ks);
>         System.out.println("COPY ME 2: " + s);

java TestForStruts
COPY ME 1: public final int java.util.LinkedHashMap$LinkedKeySet.size()
Exception in thread "main" java.lang.IllegalAccessException: Class TestForStruts can not access
a member of class java.util.LinkedHashMap$LinkedKeySet with modifiers "public final"
        at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:114)
        at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:399)
        at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:391)
        at java.lang.reflect.Method.invoke(Method.java:501)
        at TestForStruts.main(TestForStruts.java:15)

Where line 15 is:

Object s = m2.invoke(ks);

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message