`

Struts2 Caused by: java.lang.IllegalArgumentException: argument type mismatch

 
阅读更多

 

前台页面文本框 name 绑定的属性,与后台属性不一致..导致如下错误发生"

比如: <input name='userInfo.password' type='text' /> 而vo里面设置的属性是passWord.

 

 

WARN - Error setting expression 'userInfo.password' with value '[Ljava.lang.String;@14ef239'
ognl.OgnlException: password [java.lang.IllegalArgumentException: argument type mismatch]
 at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:103)
 at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:162)
 at com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(ObjectAccessor.java:28)
 at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2225)
 at ognl.ASTProperty.setValueBody(ASTProperty.java:127)
 at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
 at ognl.SimpleNode.setValue(SimpleNode.java:301)
 at ognl.ASTChain.setValueBody(ASTChain.java:227)
 at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
 at ognl.SimpleNode.setValue(SimpleNode.java:301)
 at ognl.Ognl.setValue(Ognl.java:737)
 at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:198)
 at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:161)
 at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:149)
 at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:276)
 at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
 at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)
 at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
 at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
 at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
 at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)
 at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
 at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
 at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalArgumentException: argument type mismatch
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:95)
 ... 63 more
/-- Encapsulated exception ------------\

 

 

解决方案:改正属性名称即可.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics