读书人

target is null for setProperty(null

发布时间: 2012-09-27 11:11:17 作者: rapoo

target is null for setProperty(null, "name", [Ljava.lang.String;@ffc6ae)
如题 target is null for setProperty(null, "name", [Ljava.lang.String;@ffc6ae)

严重: Could not create and/or set value back on to object
Method "setProductType" failed for object net.epsshop.action.admin.ProductTypeAction@163bad4 - Class: ognl.OgnlRuntime
File: OgnlRuntime.java
Method: callAppropriateMethod
Line: 1265 - ognl/OgnlRuntime.java:1265:-1

ognl.MethodFailedException: Method "setProductType" failed for object net.epsshop.action.admin.ProductTypeAction@163bad4 [java.lang.NoSuchMethodException: net.epsshop.action.admin.ProductTypeAction.setProductType($Proxy39)]

警告: Error setting expression 'productType.name' with value '[Ljava.lang.String;@ffc6ae'

get和set方法都有
这个破问题困扰我一天,以前遇到过,又忘了。。。(哎,人老了记性不太好了)

解决:


private ProductType productType ;
改成
private ProductType productType = new ProductType(); //初始化(其实我到现在都郁闷,以前都是没有初始化怎么都没出错,有高手路过的,知道原因的请告诉在下,谢谢了!)

读书人网 >移动开发

热点推荐