ssh框架遇到的问题总结
1.org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'driverName' of bean class [com.mchange.v2.c3p0.ComboPooledDataSource]: Bean property 'driverName' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'driverName' of bean class [com.mchange.v2.c3p0.ComboPooledDataSource]: Bean property 'driverName' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
错误翻译过来就是:driverClassName 名我 com.mchange.v2.c3p0.ComboPooledDataSource不认得,改个我认识的,不然我罢工
解决:改名
driverClassName -->driverClass
url -->jdbcUrl
username -->user
password—>password
2.Caused by: java.lang.NoClassDefFoundError: javax/transaction/SystemException
解决:确少geronimo-jta jar包
3.Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'dataSource' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/TransactionAwareDataSourceProxy
解决:<!-- 配置事务 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager">
<property name="dataSource" ref="dataSource"></property>//这里不要用dataSource.改用sessionFactory
</bean>
4.Caused by: java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy
解决:确少spring-jdbc-4.2.4.RELEASE.jar包
5.HTTP Status 500 - Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.
严重: Exception occurred during processing request: Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.
org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.
解决:在service的类上加上@Transactional注解
6.Bean 'sessionFactory'; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Tag 'property' must have a 'name' attribute
Offending resource: class path resource [applicationContext.xml]
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Tag 'property' must have a 'name' attribute
Offending resource: class path resource [applicationContext.xml]
解决:<!-- 配置hibernate映射文件 -->时<property name="">的值忘记写了
7.Caused by: java.lang.ClassNotFoundException: com.mchange.v2.ser.Indirector”
解决:缺少mchange-commons-java-0.2.3.4.jar
8.java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
解决:缺少mysql驱动jar包
9.Could not load requested class : com.ssh.entity.User
解决:因为pojo里的文件,xml的文件以及数据库里的文件之间的映射有问题
Caused by: org.springframework.aop.framework.AopConfigException: Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the class path or specify proxy interfaces.
解决:可能jar包重复也可能缺少cglib-2.1.3.jar
10.No result defined for action com.ssh.action.UserAction and result success
解决:是Struts.xml配置问题
11.Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: Emp is not mapped [from Emp]
解决:applicationContext中没有加载*.hbm.xml映射文件
12.Caused by: org.hibernate.boot.MappingException: Association [com.ssh.entity.Dept.setEmp] references an unmapped entity [com.ssh.entity.Dept.setEmp] : origin(null)
解决:是xxx.hbm.xml中<class name="com.ssh.entity.User" table="user">name中的路径应该是xxx实体类的路径,结果写到其他的实体类的路径了
13.Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'deptDaoImpl' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'sessionFactory' of bean class [com.ssh.dao.impl.DeptDaoImpl]: Bean property 'sessionFactory' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
解决:没有依赖注入
14.严重: Servlet.service() for servlet [jsp] threw exception
javax.el.PropertyNotFoundException: Property [id] not found on type [java.lang.String]
解决:jsp中输出的id与实体类的eid不一致<c:forEach items="list" var="emp">或者是<c:forEach items="list" var="emp">items中应该写成${list }
<td>${emp.id }</td>
15.Caused by: org.hibernate.MappingException: Duplicate property mapping of ename found in com.ssh.entity.Emp
解决:xxx.hbm.xml映射文件中有重复字段
16.HTTP Status 500 - not-null property references a null or transient value : com.ssh.entity.Emp.esex; nested exception is org.hibernate.PropertyValueException: not-null property references a null or transient value : com.ssh.entity.Emp.esex
解决:是xxx.hbm.xml中的属性设置为不能为空,但是我前台表单中的数据填写为空了。
17.org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unnamed bean definition specifies neither 'class' nor 'parent' nor 'factory-bean' - can't generate bean name
Offending resource: class path resource [springmvc.xml]
解决:由于:bean 没有配置完整,少了class等属性的配置或者配置了空的bean<bean></bean>
18.java.lang.IllegalArgumentException: Expected MultipartHttpServletRequest: is a MultipartResolver configured?
解决:这是因为找不到multipartReslover的原因,在springMVC配置文件配置它的时候,不能用其他名字,只能用指定名字id="multipartResolver",否则就出现这种找不到的错误。
Caused by: 元素类型为 "struts" 的内容必须匹配 "((package|include|bean|constant)*,unknown-handler-stack?)"。 - file:/E:/JavaDeveleper/apache-tomcat-9.0.0.M22/webapps/shop/WEB-INF/classes/struts.xml:17:10
解决:Struts.xml配置文件中的action要写在package中
19.java.lang.NoSuchMethodException: com.opensymphony.xwork2.ActionSupport.listAll()
解决:spring.xml核心配置文件忘记配置给应类的Javabean实例化
20.Caused by: Action class [userAction] not found - action - file:/C:/Users/smfx1314/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/sshtest/WEB-INF/classes/struts.xml:7:63
java.lang.NoSuchMethodException: com.ssh.action.UserAction.save()
解决:原因是缺少jar包:struts2-spring-plugin-2.1.8.jar或者清理缓存,project
21.There is no Action mapped for namespace [/] and action name [delete] associated with context path [/sshtest]. - [unknown location]
解决:Struts.xml中的action方法使用的是user_*的方式,在jsp页面中或其他请求中没有按照user_*的方式请求,加上前缀user就可以了
ssh框架遇到的问题总结的更多相关文章
- 简化SSH框架的整合
一.开发环境: (1) OS:Windows 7 (2) DB:MySql 5.1.6 (3) JDK:1.8.0_17 (4) Server:Apache Tomcat 8. ...
- SSH框架整合
SSH框架整合 一.原理图 action:(struts2) 1.获取表单的数据 2.表单的验证,例如非空验证,email验证等 3.调用service,并把数据传递给service Service: ...
- 基于SSH框架的网上商城的质量属性
常见质量属性 1.性能 性能就是一个东西有多快,通常指响应时间或延迟. 响应时间:从发出请求到收到响应所用的时间,比如用户点击网页中的超链接或桌面应用程序中的按钮 延迟:消息从A点到B点,通过你的系统 ...
- 【Java EE 学习 69 中】【数据采集系统第一天】【SSH框架搭建】
经过23天的艰苦斗争,终于搞定了数据采集系统~徐培成老师很厉害啊,明明只是用了10天就搞定的项目我却做了23天,还是模仿的...呵呵,算了,总之最后总算是完成了,现在该好好整理该项目了. 第一天的内容 ...
- 基于SSH框架的学生公寓管理系统的质量属性
系统名称:学生公寓管理系统 首先介绍一下学生公寓管理系统,在学生公寓管理方面,针对学生有关住宿信息问题进行管理,学生公寓管理系统主要包含了1)学生信息记录:包括学号.姓名.性别.院系.班级:2)住宿信 ...
- 对于SSH框架的选择
选择框架:SSH 对于Web开发来说,SSH框架可以提高开发效率,还可以方便需求的变更以及对后期维护方面更容易操作.SSH也是目前稍微流行的Web开发框架. 选择框架描述: 首先说明一下SSH并不是一 ...
- struts2+spring+hibernate(SSH)框架的搭建和总结
SSH框架:struts2+spring+hibernate,是目前较流行的一种Web应用程序开源集成框架,用于构建灵活.易于扩展的多层Web应用程序. struts2+spring+hibernat ...
- java ssh 框架下 利用junit4 spring-test进行单元测试
ssh框架下 由于bean实列 都交给spring 管理,要做单元测试就比较苦难,junit4 引入注解方便很多: 1. 加入依赖包 使用Spring的测试框架需要加入以下依赖包: JUnit 4 ...
- SSH框架简化
通过对ssh框架有了基础性的学习,本文主要是使用注解的方式来简化ssh框架的代码编写. 注意事项: 1.运行环境:Windows 8-64位,Eclipse(开发工具),jdk1.8.0_91,Tom ...
- 基于ssh框架开发的购物系统的质量属性
根据前面的博客,我们已经大致了解了ssh架构开发整体概念:Struts是一个实现了MVC模式的经典的框架:Hibernate是轻量级Java EE应用的持久层解决方案,以面向对象的方式提供了持久化类到 ...
随机推荐
- 谈谈单元測试之(二):測试工具 JUnit 3
前言 上一篇文章<为什么要进行烦人的单元測试?>讨论了一下现阶段软件开发中,程序猿们測试情况的现状.这篇文章中,我打算介绍一下单元測试的工具(插件).而且推荐大家以后在开发中,真正的用上单 ...
- SVN 的一些操作
SVN是一个非常好的代码管理工具. 之前一直是使用现有的SVN环境,认为非常方便. 可是近期要自己搭建一个SVN环境来托管自己的代码,并且代码放在独立的server上,所以决定自己搭建一个SVN环境. ...
- Linux 高速操作IOport
在嵌入式设备中对GPIO的操作是最主要的操作. 一般的做法是写一个单独驱动程序,网上大多数的样例都是这种.事实上linux以下有一个通用的GPIO操作接口.那就是我要介绍的 "/sys/cl ...
- 《微软的软件测试之道》【PDF】下载
<微软的软件测试之道>[PDF]下载链接: https://u253469.pipipan.com/fs/253469-230382291 内容简介 书的第三部分探讨某些我们工作中使用过的 ...
- JMeter接口测试系列:Jmeter+jenkins+ant 的自动化构建
在JMeter接口测试不断深入的过程中,发现可以和jenkins和ant一起搭配进行自动化的构建.下面是jmeter自动化构建的整理笔记. 准备环境 需要本机上确定安装了jmeter.ant和jenk ...
- iOS 应用中加载文档pdf/word/txt
一.加载PDF文档:应用内打开文档.手机中其他应用打开文档 Demo 首先拖入一个文档pdf.word.txt,打开不同的文档知识 文件名字.类型修改即可 #import "ReadView ...
- 系统内置委托:Func/Action
lSystem.Func 代表有返回类型的委托 lpublic delegate TResult Func<out TResult>(); lpublic delegate TResul ...
- [数据清洗]- Pandas 清洗“脏”数据(二)
概要 了解数据 分析数据问题 清洗数据 整合代码 了解数据 在处理任何数据之前,我们的第一任务是理解数据以及数据是干什么用的.我们尝试去理解数据的列/行.记录.数据格式.语义错误.缺失的条目以及错误的 ...
- Q:javax.comm 2.0 windows下Eclipse的配置
@转自http://blog.csdn.net/zhuanghe_xing/article/details/7523744处 要在Windows下,对计算机的串口或并口等进行编程,可以选择使用Java ...
- flask连接sqlalchemy数据库,实现简单的登录跳转功能
环境:python2.7 python库:flask,flask_wtf,wtforms,sqlalchemy 原理:运行app-连接数据库-打开登录页面-输入登录信息(错误->提示错误信息:正 ...