can not access a member of class org.springframework.aop.TruePointcut with modifiers public

前端 未结 2 1249
傲寒
傲寒 2021-02-02 14:32

I am developing a Spring application using Struts and the Struts JSON plugin. When I run the application it gives the following error (in Firebug):

org.apache.st         


        
相关标签:
2条回答
  • 2021-02-02 15:17

    This class is not public itself. It is package protected (see here). You have to call setAccessible(true) before access its member exactly as when you access private or protected member.

    EDIT. Unfortunately you have not provided full stack trace. If this exception is result of your activity (I mean you try to access member of Spring class yourself) the solution is above. If however this happened as result of frameworks collision please send more details. Probably your versions of Struts and Spring are not compatible or some additional configuration is required.

    0 讨论(0)
  • 2021-02-02 15:17

    In my case I was trying to access public constructor of a non public class.

    class MyClass {
      public MyClass() {}
    }
    
    //...
    MyClass c = JsonIterator.deserialize(bytes, MyClass.class)
    

    Throws: ReflectionMapDecoder can not access a member of class MyClass with modifiers "public"

    Added public and it works.

    public class MyClass {
      public MyClass() {}
    }
    

    HTH

    0 讨论(0)
提交回复
热议问题