ibatis使用问题求解
小弟最近项目中用到了ibatis,这两天一直报错,请教ibatis大神
sql配置如下:
<select id="getCpVoucherForCpDvtList"
resultMap="cpVoucherResultCheckIn"
parameterClass="elementCondition">
select master.* from cp_voucher master where
master.sum_cp_voucher_id is null
and master.is_valid='1'
<isNotNull prepend="AND" property="passwdStatus">
master.PAY_PWD_STATE = #passwdStatus#
</isNotNull>
</select>
参数类属性如下:
private String passwdStatus;
public String getPasswdStatus() {
return passwdStatus;
}
public void setPasswdStatus(String passwdStatus) {
this.passwdStatus = passwdStatus;
}
下面是报错信息:
com.ufgov.gk.common.system.exception.OtherException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0];
--- The error occurred in sqlmap/cp/CpVoucher.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the CpVoucher.getCpVoucherForCpDvtList.
--- Check the parameter map.
--- Cause: com.ibatis.common.beans.ProbeException: There is no READABLE property named 'passwdStatus' in class 'com.ufgov.gk.common.system.dto.ElementConditionDto'; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in sqlmap/cp/CpVoucher.xml.
--- The error occurred while preparing the mapped statement for execution.
--- Check the CpVoucher.getCpVoucherForCpDvtList.
--- Check the parameter map.
--- Cause: com.ibatis.common.beans.ProbeException: There is no READABLE property named 'passwdStatus' in class 'com.ufgov.gk.common.system.dto.ElementConditionDto'
at com.ufgov.gk.server.system.log.SystemExceptionLog.afterThrowing(SystemExceptionLog.java:27)
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:324)
at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invokeHandlerMethod(ThrowsAdviceInterceptor.java:146)
at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:131)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
at org.springfraework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.sprigframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:631)
at com.ufgov.gk.server.cp.publish.impl.CpVoucherServiceDelegate$$EnhancerByCGLIB$$f7339278.getCpVoucherForCpDvtList(<generated>)
at com.ufgov.gk.server.cp.publish.impl.exporter.CpVoucherServiceExporter.getCpVoucherForCpDvtList(CpVoucherServiceExporter.java:419)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflectNativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:192)
at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:110)
at com.caucho.hessian.server.HessianServlet.service(HessianServlet.java:416)
at weblogic.serlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6722)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
求指导啊,已经困扰好多天了
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
有没有可能是类冲突了,可以用 类名.class.getProtectionDomain().getCodeSource().getLocation() 看看这个类在什么位置的,再反编译看看里面有没有那个属性。
比如之前部署可一个a.jar, 升级之前做了个备份叫a.bak.jar, 这样a.jar和a.bak.jar同时存在了
两种方法依然是报这个错
完整配置已贴出,查看楼下回答
配置已贴出,resultMap中加入passwdStatus启动就报there is no writeable property in class CpVoucher ,可是我这个类中也加入了passwdStatus属性,get和set方法也都有
包含这个属性,而且有set和get方法
resultMap加入这个属性启动服务会报错,会把READABLE变为WRITEABLE
回复
检查 elementCondition 别名是不是引用错了。。。。。。只有这一个属性 有问题吗...实验换个属性试试
回复
这条sql有很多属性,我只是截了一部分,就这个属性报错
get和set都是有的,上面已经贴出来了类中相应的属性及方法