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的更多相关文章

  1. (四)值栈与OGNL

    所有的学习我们必须先搭建好Struts2的环境(1.导入对应的jar包,2.web.xml,3.struts.xml) 第一节:值栈简介 值栈是对应每个请求对象的一套内存数据的封装,Struts2 会 ...

  2. JSP精华知识点总结

    本文转自:http://blog.csdn.net/qy1387/article/details/8050239 JSP精华知识点总结 Servlet三个要素 1.必须继承自HttpServlet 2 ...

  3. Servlet一些基础

    Servlet 是一套规范,规定了如何通过Java代码来开发动态网站,并由 javax.servlet 和 javax.servlet.http 两个包中的类来实现. servlet是一个服务器端组建 ...

  4. java web 基本属性

    page指令 属性 描述 默认值 language 指定JSP页面使用的脚本语言 java import contenType include指令 taglib注释 <!--我是html注释-- ...

  5. 初识Jsp,JavaBean,Servlet以及一个简单mvc模式的登录界面

    1:JSP JSP的基本语法:指令标识page,include,taglib;page指令标识常用的属性包含Language用来定义要使用的脚本语言:contentType定义JSP字符的编码和页面响 ...

  6. json、javaBean、xml互转的几种工具介绍

    json.javaBean.xml互转的几种工具介绍 转载至:http://blog.csdn.net/sdyy321/article/details/7024236 工作中经常要用到Json.Jav ...

  7. java高新技术-操作javaBean

    1. 对javaBean的简单内省操作 public class IntroSpectorTest { public static void main(String[] args) throws Ex ...

  8. jsp 以及javabean内省技术

    l JSP l JavaBean及内省 l EL表达式 1.1 上次课内容回顾 会话技术: Cookie:客户端技术.将数据保存在客户端浏览器上.Cookie是有大小和个数的限制. Session:服 ...

  9. ireport5.6+jasperreport6.3开发(五)--以javabean为基准的报表开发(action关联)

    这里的是定方法主要参照sturts2-jasperreport-plugin的完成方法(其实就是抄的) PDF的样子是这样的两页的pdf 然后action的配置是这样的(不要在意格式) @Parent ...

  10. javabean连数据库

    1.在src下建包,然后包中建javabean类,代码如下(我的包名为aa) package aa; import java.sql.*; public class bean { private fi ...

随机推荐

  1. MVC扩展生成CheckBoxList并水平排列

    本篇体验生成CheckBoxList的几个思路,扩展MVC的HtmlHelper生成CheckBoxList,并使之水平排开.     通过遍历从控制器方法拿到的Model集合 □ 思路 比如为一个用 ...

  2. Unity的界面排版: RectTransform

    看Unity3D文档像看国内教课书一样,一些概念,不懂的时候看还是不懂,明白了以后再看,好像也没有说错.好几个做Unity3D的朋友跟我吐槽过U3D的文档质量,相比Apple贴心的技术文档相去甚远. ...

  3. 如何构建Win32汇编的编程环境(ONEPROBLEM个人推荐)

      如何构建Win32汇编的编程环境(ONEPROBLEM个人推荐)1.首先要下载我提供的软件包(里面已经包含所有所需软件); 2.把它解压到D盘根目录下(如果需要安装在其它的地方,请注意设好路径); ...

  4. mahout源码分析之DistributedLanczosSolver(五)Job over

    Mahout版本:0.7,hadoop版本:1.0.4,jdk:1.7.0_25 64bit. 1. Job 篇 接上篇,分析到EigenVerificationJob的run方法: public i ...

  5. Python并发编程-redis-3.0.5 源码安装

    1.简介 Remote Dictionary Server(Redis)是一个基于 key-value 键值对的持久化数据库存储系统.redis 和 Memcached 缓存服务很像,但它支持存储的 ...

  6. [leetcode]Insertion Sort List @ Python

    原题地址:http://oj.leetcode.com/problems/insertion-sort-list/ 题意:对链表进行插入排序. 解题思路:首先来对插入排序有一个直观的认识,来自维基百科 ...

  7. 【Gson】简介 文档 基本使用 示例

    简介 new TypeToken<List<Person>>() {}.getType() 1 1   1 new TypeToken<List<Person> ...

  8. jquery选择器用法笔记(第二部分)

    今天继续讲讲jquery选择器的更多用法,希望能给大家带来帮助. 9.$("ul li:eq(3)")  --  列表中的第四个元素(index 从 0 开始) :eq() 选择器 ...

  9. JQuery巧妙利用CSS操作打印样式

    一.添加打印样式 1. 为屏幕显示和打印分别准备一个css文件,如下所示:  用于屏幕显示的css: <link rel="stylesheet" href="cs ...

  10. NSURLSession下载和断点续传

    NSURLSession是iOS7之后新的网络接口,和经常用到NSURLConnection是类似的.在程序在前台时,NSURLSession与NSURLConnection可以相互的替代.但是当用户 ...