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应用的持久层解决方案,以面向对象的方式提供了持久化类到 ...
随机推荐
- RT5350的uvc驱动支持yuv格式摄像头成功
请尊重别人的劳动成果 转载请务必注明出处 今天在rt5350的板子上,成功将仅仅支持yuv格式的usb camera摄像头执行了.採用的是mjpeg streamer ,须要libjpeg库支持yuv ...
- bmp文件格式中rgb555与rgb888之间的转换,24位与16位位图的转换
今日,有同事问我.rgb555模式下的位图文件的格式问题,于是花了一下午的时间通过推測与測试,分析出了例如以下bmp文件在rgb555模式下的文件存储规律: 1:bmp文件的文件信息头中的biBitC ...
- AOP入门(转)
本文转自http://www.cnblogs.com/yanbincn/archive/2012/06/01/2530377.html Aspect Oriented Programming 面向切 ...
- 自学Zabbix3.6.4-触发器triggers dependencies依赖关系
有时,一个主机的可用性取决于另一个主机.如果路由器坏了,某个路由器后面的服务器就会变得不可访问.对于两个主机都配置了触发器,您可能会收到两个主机的通知,而只有路由器是有罪的一方.这是主机之间的一些依赖 ...
- springboot整合系列
Spring Boot 系列 博客原文:http://blog.csdn.net/isea533/article/details/50412212 Spring Boot 入门 Spring Boot ...
- 【python】BIF及查看函数帮助
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 07:18:10) [MSC v.1900 32 bit (Intel)] on win32 Type ...
- iOS学习——内存泄漏检查及原因分析
项目的代码很多,前两天老大突然跟我说项目中某一个ViewController的dealloc()方法没有被调用,存在内存泄漏问题,需要排查原因,解决内存泄漏问题.由于刚加入项目组不久,对出问题的模块的 ...
- mentohust 使用
可使用帮助命令 mentohust -h 或着查看 https://wenku.baidu.com/view/95c08019ff00bed5b9f31d1a.html
- linux集群批量执行命令
因为工作需要,需要修改集群中机器的配置,一台一台的修改太浪费时间,就想能不能通过自动化脚本批量执行命令,尝试写一个,自己shell不熟悉,写的有点渣渣 if [ "$#" -ne ...
- xamarin android制作圆角边框
xamarin android制作圆角边框 效果图如下: 关键代码: drawable文件夹新建shape_corner_down.xml <?xml version="1.0&quo ...