java.lang.IllegalArgumentException: Cannot convert value of type [] to required type [] for property

8 篇文章 0 订阅

遭遇下面的莫名其妙的错误,提示 参数错误:action 和 bean 模型类型不匹配。


后来仔细检查才发现,在struts的action配置里边设置的action name,与action类里边的一个 bean 名称一样了,在传递参数时产生了歧义,修改action name为其他既可以解决。


结论: 不要把 action name的属性设置成和 action bean 一样的名称。


  1. 严重: Servlet.service() for servlet default threw exception
  2. java.lang.IllegalArgumentException: Cannot convert value of type [com.blog.Actiion.PkindAction] to required type [com.blog.Model.Pkind] for property 'pkind': no matching editors or conversion strategy found
  3. at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
  4. at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
  5. at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:380)
  6. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1101)
  7. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:857)
  8. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:274)
  9. at com.opensymphony.xwork2.spring.SpringObjectFactory.autoWireBean(SpringObjectFactory.java:167)
  10. at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:154)
  11. at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:128)
  12. at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:143)
  13. at com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:113)
  14. at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:275)
  15. at com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:365)
  16. at com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38)
  17. at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:83)
  18. at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
  19. at com.opensymphony.xwork2.DefaultActionInvocation.<init>(DefaultActionInvocation.java:74)
  20. at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)
  21. at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
  22. at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
  23. at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
  24. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  25. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  26. at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  27. at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  28. at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  29. at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  30. at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  31. at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
  32. at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
  33. at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
  34. at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
  35. at java.lang.Thread.run(Unknown Source)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值