Spring mvc项目的异常报告

  Spring mvc项目的异常报告

异常报告一:
org.hibernate.id.IdentifierGenerationException: Unknown integral data type for ids : java.lang.String
主键类型是int类型自增长策略,Java类中设置的是String类型,因此不匹配,报错

异常报告二(从日志中查看信息):
INFO: HHH000114: Handling transient entity in delete processing
删除的数据必须是你这次session范围内刚刚从数据库取回来的数据,而不能是你刚刚new的对象,即使是与数据库记录相同,也是不可以的。

说明:
dao层方法错误,save方法里调用了delete方法,传入对象是new出来的,而此时数据库表是空的,因此发出上述信息。将dao层方法修改完后问题解决。

异常报告三:

org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from file [D:\myeclipse10\myeclipse10WorkSpace\HRSystemVersion01\WebRoot\WEB-INF\classes\config\spring\spring-common.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor   
说明:出现NoClass字样,可能缺少某些jar包,百度之,可解。

异常报告三:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [D:\myeclipse10\myeclipse10WorkSpace\HRSystemVersion01\WebRoot\WEB-INF\classes\config\spring\spring-common.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;     
说明:在javax的持久化包里没有这样的方法,可能包冲突,百度之可解


异常报告四(spring和Hibernate的使用版本结合问题):

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [D:\myeclipse10\myeclipse10WorkSpace\HRSystemVersion01\WebRoot\WEB-INF\classes\config\spring\spring-common.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Error applying BeanValidation relational constraints
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1486)



解决方法: 更好的解决方案

同异常报告四
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0': Invocation of init method failed; nested exception is javax.validation.ValidationException: Unable to instantiate Configuration.

异常报告六:这是一个日志的警告信息,但是日志先前打印了mapped  URL的信息,说明xml中的静态资源访问设置没有问题,问题在于spring mvc经过Controller的返回后其jsp页面上的资源路径设置的问题,在某些情况下的配置可能好使,然而在其他情况下却不一定,因此需要一种一劳永逸的解决方案,在JSP中添加talib标签用于管理静态资源的路径。

警告: No mapping found for HTTP request with URI [at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1486)

信息: Mapped URL path [/js/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'
2014-10-21 20:13:12 org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
信息: Mapped URL path [/css/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#1'
2014-10-21 20:13:12 org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
信息: Mapped URL path [/images/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#2'
2014-10-21 20:13:12 org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
信息: Mapped URL path [/themes/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#3'
说明:在这个异常中有很多人已经吃过苦头了,这里有先人的经验: 解决方案

异常报告七:这个异常出现的非常诡异,昨天还好使的工程今天一运行就出现这个错误了,没办法百度之,将spring-tx-4.0.xsd添加到myeclipse 的xml配置中,后来又出现这种错误,然后关机重启,又消失了,无语

p://www.springframework.org/schema/tx/spring-tx-4.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值