EXCEPTION-javaBean
CreateTime--2016年11月24日14:29:43
Author:Marydon
声明:异常类文章主要是记录了我遇到的异常信息及解决方案,解决方案大部分都是百度解决的,(这里只是针对我遇到的做个汇总),特此声明!
Action异常
2016-11-12 15:17:08,931[ERROR][org.apache.struts2.dispatcher.Dispatcher]:Exception occurred during processing request: Unable to instantiate Action, jcxx.web.actions.monitor.MediDepartAction, defined for 'index' in namespace '/jcxx/server/monitor/medidepart'com.sun.proxy.$Proxy22 cannot be cast to jcxx.service.bo.config.feeitem.IBoTDICTCHARGEITEM
spring的XML文件中的BO配置
<!--中心药品诊疗维护-->
<bean id="boTDICTCHARGEITEM_Jcxx" parent="txTransactionProxyJcxx">
<property name="target">
<bean class="jcxx.service.bo.config.feeitem.impl.BoTDICTCHARGEITEMImpl">
<constructor-arg index="0" ref="daoTDICTCHARGEITEM_Jcxx"/>
</bean>
</property>
</bean>
解决方案:
//service层对应的Action引入业务层接口的方法
iBoItem = (IBoTDICTCHARGEITEM) BeansHelp.getBeanInstance("boTDICTCHARGEITEM");
更改为:
iBoItem = (IBoTDICTCHARGEITEM) BeansHelp.getBeanInstance("boTDICTCHARGEITEM_Jcxx");
sqlMap异常
com.ibatis.sqlmap.client.SqlMapException: There is no statement named xnh.config.getTDICTCODE_COUNT_test in this SqlMap.
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.getMappedStatement(SqlMapExecutorDelegate.java:232)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:510)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:494)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:82)
at xnh.service.dao.config.dict.impl.DaoTDICTCODEImpl.getTDICTCODE_COUNT(DaoTDICTCODEImpl.java:53)
at xnh.service.bo.config.dict.impl.BoTDICTCODEImpl.getTDICTCODE_COUNT(BoTDICTCODEImpl.java:58)
原因:
sqlMap是由Dao层实现类调用的sql语句,异常的意思是:在"xnh.config"这个命名空间下没有找到id="getTDICTCODE_COUNT_test"的sql语句
UpdateTime--2017年1月7日17:14:07
spring异常:
nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'boBASE_ORG_INFOImpl' of bean class [com.xyhsoft.demo.service.bo.mq.MQReceiver]: Bean property 'boBASE_ORG_INFOImpl' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
spring对应的配置:
<!-- 组织机构维护 -->
<bean id="boBASE_ORG_INFOImpl" class="com.xyhsoft.demo.service.bo.organize.impl.BoBASE_ORG_INFOImpl">
<constructor-arg index="0" ref="daoBASE_ORG_INFOImpl" />
</bean>
<bean id="daoBASE_ORG_INFOImpl" class="com.xyhsoft.demo.service.dao.organize.impl.DaoBASE_ORG_INFOImpl">
<property name="sqlMapClient" ref="sqlMapClient" />
</bean>
原因:
MQReceiver.java类没有set注入"boBASE_ORG_INFOImpl"
解决方案:
// 组织机构
private IBoBASE_ORG_INFO boBASE_ORG_INFOImpl;
/**
* @param boBASE_ORG_INFOImpl
*/
public void setBoBASE_ORG_INFOImpl(IBoBASE_ORG_INFO boBASE_ORG_INFOImpl) {
this.boBASE_ORG_INFOImpl = boBASE_ORG_INFOImpl;
}
异常四(Dao层实现类出异常)
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao' defined in class path resource [com/config/userConfig.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'sqlMapClient' of bean class [com.service.user.dao.impl.DaoUser]: Bean property 'sqlMapClient' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
解决方案:
dao实现类没有继承extends SqlMapClientDaoSupport
异常五(Bo层实现类出异常)
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userBiz' defined in class path resource [com/config/userConfig.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'userDao' of bean class [com.service.user.bo.impl.BoUser]: Bean property 'userDao' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
解决方案:
spring的配置文件中,name值与要调用该对象声明的属性名保持一致
<!-- 配置Bo,调Dao -->
<bean id="userBo" class="com.service.user.bo.impl.BoUser">
<!-- 此处的name值,必须与业务层实现类声明的Dao层的属性名相同 -->
<property name="daoUser" ref="userDao"/>
</bean>
Bo层
//调用dao层用户类,spring托管实例化
private IDaoUser daoUser;
public void setDaoUser(IDaoUser daoUserImpl) {
this.daoUser = daoUserImpl;
}
异常六(set注入异常)
Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type [com.sun.proxy.$Proxy9 implementing com.xyhsoft.demo.service.bo.dictionary.IBoBASE_DICTIONARY,
org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.xyhsoft.demo.service.bo.organize.IBoBASE_ORG_INFO] for property 'boBASE_DICTIONARYImpl';
nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.sun.proxy.$Proxy9 implementing com.xyhsoft.demo.service.bo.dictionary.IBoBASE_DICTIONARY,
org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.xyhsoft.demo.service.bo.organize.IBoBASE_ORG_INFO] for property 'boBASE_DICTIONARYImpl': no matching editors or conversion strategy found
原因:
// 组织机构
private IBoBASE_ORG_INFO boBASE_ORG_INFOImpl;
// 字典管理
private IBoBASE_ORG_INFO boBASE_DICTIONARYImpl; public void setBoBASE_DICTIONARYImpl(IBoBASE_ORG_INFO boBASE_DICTIONARYImpl) {
this.boBASE_DICTIONARYImpl = boBASE_DICTIONARYImpl;
} public void setBoBASE_ORG_INFOImpl(IBoBASE_ORG_INFO boBASE_ORG_INFOImpl) {
this.boBASE_ORG_INFOImpl = boBASE_ORG_INFOImpl;
}
声明重复:同一个变量类型:IBoBASE_ORG_INFO ,不同的变量名和set方法
UpdateTime--2017年9月4日16:30:36
异常七(缺少jar包)
java.lang.ClassNotFoundException: org.apache.commons.lang.exception.NestableRuntimeException
解决方案:
1.缺少jar包 commons-lang.jar;
2.看这个jar包需要的是2.*版本,还是3.*版本,(文件存放目录不同)
EXCEPTION-javaBean的更多相关文章
- (四)值栈与OGNL
所有的学习我们必须先搭建好Struts2的环境(1.导入对应的jar包,2.web.xml,3.struts.xml) 第一节:值栈简介 值栈是对应每个请求对象的一套内存数据的封装,Struts2 会 ...
- JSP精华知识点总结
本文转自:http://blog.csdn.net/qy1387/article/details/8050239 JSP精华知识点总结 Servlet三个要素 1.必须继承自HttpServlet 2 ...
- Servlet一些基础
Servlet 是一套规范,规定了如何通过Java代码来开发动态网站,并由 javax.servlet 和 javax.servlet.http 两个包中的类来实现. servlet是一个服务器端组建 ...
- java web 基本属性
page指令 属性 描述 默认值 language 指定JSP页面使用的脚本语言 java import contenType include指令 taglib注释 <!--我是html注释-- ...
- 初识Jsp,JavaBean,Servlet以及一个简单mvc模式的登录界面
1:JSP JSP的基本语法:指令标识page,include,taglib;page指令标识常用的属性包含Language用来定义要使用的脚本语言:contentType定义JSP字符的编码和页面响 ...
- json、javaBean、xml互转的几种工具介绍
json.javaBean.xml互转的几种工具介绍 转载至:http://blog.csdn.net/sdyy321/article/details/7024236 工作中经常要用到Json.Jav ...
- java高新技术-操作javaBean
1. 对javaBean的简单内省操作 public class IntroSpectorTest { public static void main(String[] args) throws Ex ...
- jsp 以及javabean内省技术
l JSP l JavaBean及内省 l EL表达式 1.1 上次课内容回顾 会话技术: Cookie:客户端技术.将数据保存在客户端浏览器上.Cookie是有大小和个数的限制. Session:服 ...
- ireport5.6+jasperreport6.3开发(五)--以javabean为基准的报表开发(action关联)
这里的是定方法主要参照sturts2-jasperreport-plugin的完成方法(其实就是抄的) PDF的样子是这样的两页的pdf 然后action的配置是这样的(不要在意格式) @Parent ...
- javabean连数据库
1.在src下建包,然后包中建javabean类,代码如下(我的包名为aa) package aa; import java.sql.*; public class bean { private fi ...
随机推荐
- maven里如何根据不同的environment打包
一个项目里总会有很多配置文件.而且一般都会有多套环境.开发的.测试的.正式的.而在这些不同的环境这些配置的值都会不一样.比如mail的配置.服务的url配置这些都是很常见的.所以在打包的时候就要根据e ...
- mysql 连接出错 'mysqladmin flush-hosts'
本文章 转载于: http://blog.itechol.com/space-33-do-blog-id-5670.html 求助QQ:499628121 环境说明: 内网测试服务器19 ...
- HDU5087 Revenge of LIS II (LIS变形)
题目链接:pid=5087">http://acm.hdu.edu.cn/showproblem.php?pid=5087 题意: 求第二长的最长递增序列的长度 分析: 用step[i ...
- MVC文件上传03-使用Request.Files上传多个文件
本篇体验在控制器方法中使用controllerContext.HttpContext.Request.Files上传多个文件.兄弟篇为: MVC文件上传01-使用jquery异步上传并客户端验证类型和 ...
- matlab进行地图仪的绘制
% 绘制地球仪,并标出我们的位置 cla reset; load topo; [x,y,z] = sphere();%45是画出来的球面的经纬分面数 s = surface(x,y,z,'FaceCo ...
- Android 性能优化之使用MAT分析内存泄露
转载请注明本文出自xiaanming的博客(http://blog.csdn.net/xiaanming/article/details/42396507),请尊重他人的辛勤劳动成果,谢谢! 我们平常 ...
- Android之zip包换肤(极力推荐)
转自:http://www.eoeandroid.com/thread-102536-1-1.html 直接上图,以图为证,哈哈 第一图为原始的皮肤:<ignore_js_op> 第二种为 ...
- UVC调试
USB video class(又称为USB video device class or UVC)就是USB device class视频产品在不需要安装任何的驱动程序下即插即用,包括摄像头.数字摄影 ...
- easyui datagrid 计算
转载,至高吴上(Alfa.wu) !谢谢! /******************************************************** 主要用于 明细表格 字段间的计算 Sta ...
- Spark一个简单案例
Spark是一个类似Map-Reduce的集群计算框架,用于快速进行数据分析. 在这个应用中,我们以统计包含"the"字符的行数为案例,.为建立这个应用,我们使用 Spark 1. ...