http://www.forfreezone.com

ssh框架遇到的问题总结澳门金沙官网网址

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中的属性设置为不可能为空,不过自己前台表单中的数据填充为空了。

 

4.Caused by: java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy
解决:确少spring-jdbc-4.2.4.RELEASE.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>

Caused by: 成分类型为 "struts" 的内容必需相称"((package|include|bean|constantState of Qatar*,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中

解决:<!-- 配置hibernate映射文件 -->时<property name="">的值忘记写了

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>

12.Caused by: org.hibernate.boot.MappingException: Association [com.ssh.entity.Dept.setEmp] references an unmapped entity [com.ssh.entity.Dept.setEmp] : origin(null)

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.

14.严重: Servlet.service() for servlet [jsp] threw exception
javax.el.PropertyNotFoundException: Property [id] not found on type [java.lang.String]

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?
不留余地:未有依据注入

减轻:原因是缺少jar包:struts2-spring-plugin-2.1.8.jar要么清理缓存,project

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?

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]

19.java.lang.NoSuchMethodException: com.opensymphony.xwork2.ActionSupport.listAll()
缓慢解决:spring.xml主旨配置文件忘记配置给应类的Javabean实例化

11.Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: Emp is not mapped [from Emp]
解决:applicationContext中从未加载*.hbm.xml映射文件

2.Caused by: java.lang.NoClassDefFoundError: javax/transaction/SystemException
解决:确少geronimo-jta jar包

9.Could not load requested class : com.ssh.entity.User
缓慢解决:因为pojo里的公文,xml的公文甚至数据库里的文件之间的映射有标题

18.java.lang.IllegalArgumentException: Expected MultipartHttpServletRequest: is a MultipartResolver configured?
解决:这是因为找不到multipartReslover的来由,在springMVC配置文件配置它的时候,不能够用别的名字,只可以用内定名字id="multipartResolver",不然就涌出这种找不到的不当。

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

化解:jsp中输出的id与实体类的eid不相像<c:forEach items="list" var="emp">只怕是<c:forEach items="list" var="emp">items中应该写成${list }
<td>${emp.id }</td>

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()

15.Caused by: org.hibernate.MappingException: Duplicate property mapping of ename found in com.ssh.entity.Emp
化解:xxx.hbm.xml映射文件中有再一次字段

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

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包

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就能够了

化解:在service的类上助长@Transactional申明

化解:是xxx.hbm.xml中<class name="com.ssh.entity.User" table="user">name中的路线应该是xxx实体类的门路,结果写到其余的实体类的门路了

10.No result defined for action com.ssh.action.UserAction and result success
焚薮而田:是Struts.xml配置难题

郑重声明:本文版权归澳门新葡8455最新网站所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。