1

In my Struts2 application, which involves some multi-threading, I get the following warning in my logs:

Access to static [private static final java.lang.String ...] is blocked!

What does this warning mean and how can I avoid it?

Roman C
  • 49,761
  • 33
  • 66
  • 176
Tobias Nolte
  • 103
  • 2
  • 12
  • Outside the class, you cannot access private fields, Unless you use [java reflection](https://stackoverflow.com/questions/37628/what-is-reflection-and-why-is-it-useful) – Mustapha Belmokhtar Dec 22 '17 at 11:29
  • 1
    Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a [mcve]. Use the [edit] link to improve your *question* - do not add more information via comments. Thanks! – GhostCat Dec 22 '17 at 13:10

1 Answers1

1

Static access is disabled by default. Here you can learn more about static accessors.

OGNL allows execution of methods, but the static access is disabled by default, so you cannot use static method in expressions. However, you can teach OGNL which classes needs to access the static methods.

Roman C
  • 49,761
  • 33
  • 66
  • 176