This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes ognl.OgnlException: target is null for setProperty(null, Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ognl.OgnlException: target is null for setProperty(null, "preventCache", [Ljava.lang.String;@6dc5f0b" Watch "ognl.OgnlException: target is null for setProperty(null, "preventCache", [Ljava.lang.String;@6dc5f0b" New topic
Author

ognl.OgnlException: target is null for setProperty(null, "preventCache", [Ljava.lang.String;@6dc5f0b

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 573
Not sure if this is a struts problem more a OGNL problem

I am getting the following exception, I just want to understand it first.

21-Apr-2010 17:26:35 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: Error setting value
ognl.OgnlException: target is null for setProperty(null, "preventCache", [Ljava.lang.String;@6dc5f0ba)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1651)
at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
at ognl.SimpleNode.setValue(SimpleNode.java:246)
at ognl.ASTChain.setValueBody(ASTChain.java:172)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
at ognl.SimpleNode.setValue(SimpleNode.java:246)
at ognl.Ognl.setValue(Ognl.java:476)


As I understand it looking at http://www.docjar.com/html/api/ognl/OgnlRuntime.java.html

its trying to set a value Ljava.lang.String;@6dc5f0ba on a target object that if I am reading the code right has as a setter setPreventCache

Target = null
name = preventCache
value = Ljava.lang.String;@6dc5f0ba.

I am not sure how this is being called from my code.

In my struts properties I have struts.ognl.allowStaticMethodAccess=true .



 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ognl.OgnlException: target is null for setProperty(null, "preventCache", [Ljava.lang.String;@6dc5f0b
 
Similar Threads
jsp tag pagination and tiles
Struts 2 & DateTimePicker: Works fine but throws Exception.
error while submitting the page
from struts 2.0. to 2.1 - tokenSession
How does strut actions cope with hidden fields such as token