ognl.MethodFailedException: Method "setUpId" failed for object

最近写项目的时候,因为要在一个JS中定向到一个action中,所以写了这样一个URL:
this.location="toAdd.action?upid="+upid+"&ntype="+ntype;
结果竟然报错,
ognl.MethodFailedException: Method "setUpId" failed for object
百度一下,知道原因:从页面上传的所有参数都是默认string类型的,大家传ID的时候就知道,
如:int id=Integer.parseInt(request.getParameter("id"));这里有个类型转换的过程,而在struts2中所有的实体类的参数传递的时候它都要跟实体类类型对应。问题找到了 ,但是不知道解决办法,然后在http://501565246-qq-com.iteye.com/blog/788146;这位兄弟的博客上找到了同样的问题,按照他的解决办法,果真能解决,但是我出的这个异常时直接使得项目报错的,有些人的这个问题对项目每什么影响,不知道为什么?而且修改Log4j的配置文件能避免这异常的产生,我也搞不清楚原因,有知道的请留言下
2025-04-01 10:40:39.119 TRACE [org.springframework.web.method.HandlerMethod] - Arguments: [org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'null != deviceNo and deviceNo.size() > 0'. Cause: org.apache.ibatis.ognl.MethodFailedException: Method "size" failed for object false [java.lang.NoSuchMethodException: java.lang.String.size()]] org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'null != deviceNo and deviceNo.size() > 0'. Cause: org.apache.ibatis.ognl.MethodFailedException: Method "size" failed for object false [java.lang.NoSuchMethodException: java.lang.String.size()] at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:96) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441) at com.sun.proxy.$Proxy100.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:166) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:77) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) at com.sun.proxy.$Proxy119.timePeriodTraffic(Unknown Source) at com.syzn.dv.biz.yunk.southbound.adapter.repo.impl.YunkStatisticDataRepoImpl.timePeriodTraffic(YunkStatisticDataRepoImpl.java:145) at com.syzn.dv.biz.yunk.manager.impl.YunkBigScreenManagerImpl.getTimePeriodTraffic(YunkBigScreenManagerImpl.java:120) at com.syzn.dv.biz.yunk.northbound.appservice.impl.YunkBigScreenAppServiceImpl.getTimePeriodTraffic(YunkBigScreenAppServiceImpl.java:58) at com.syzn.dv.biz.big
最新发布
04-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值