新闻正文

Hibernate错误Could not execute JDBC batch update

来源:JAVA天堂  J2EE  2007-6-2 00:40:44 网友评论 0 条 字体:[ ] ~我要投稿!
Could not execute JDBC batch update 这个错误, 一搜索, 有个文章帮我了: http://www.blogjava.net/crazycy/archive/2006/07/07/57214.html
1.      错误: java.lang.NullPointerException

原因: 发现 dao 实例、 manage 实例等需要注入的东西没有被注入

解决:这个时候,你应该查看日志文件;默认是应用服务器的 log 文件,比如 Tomcat 就是 [Tomcat 安装目录 ]/logs ;你会发现提示你:

可能是:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sf' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.HibernateException: could not configure from URL: file:src/hibernate.cfg.xml

org.hibernate.HibernateException: could not configure from URL: file:src/hibernate.cfg.xml

……………………….

Caused by: java.io.FileNotFoundException: srchibernate.cfg.xml

可能是:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.MappingException: Resource: com/mcc/coupon/model/UserRole.hbm.xml not found

org.hibernate.MappingException: Resource: com/mcc/coupon/model/UserRole.hbm.xml not found

然后你就知道原因是因为配置文件的解析出了错误,这个通过 Web 页面是看不出来的。

更多的是持久化影射文件出的错误;导致了没有被解析;当然你需要的功能就无法使用了。

 

 

 2.      错误:

StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
javax.servlet.jsp.JspException: Cannot retrieve mapping for action /settlementTypeManage

或者:

    type Status report

    message Servlet action is not available

    description The requested resource (Servlet action is not available) is not available.


原因:
1

 

3.       错误

StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception

java.lang.ClassNotFoundException: org.apache.struts.taglib.bean.CookieTei

界面错误具体描述:
org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: org.apache.struts.taglib.bean.CookieTei


    原因与解决:

  <方案一>你的“html:”开头的标签没有放在一个<html:form>

     <方案>重新启动你的应用服务器,自动就没有这个问题了

收藏到ViVi   收藏此页到365Key
上一篇:一个完整的Socket例子
下一篇:hibernate错误Could not execute JDBC batch update(2)
用户名:新注册) 密码: 匿名评论 [所有评论]
评论内容:不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
本栏搜索
  • Google
   网站首页 -  网站地图 -  技术学习 -  网站投稿 -  帮助中心
Copyright 2003-2008 www.javah.net All Rights Reserved
2008 如果你喜欢本站 请收藏本站 并推荐给你的朋友一起分享