随笔 - 22  文章 - 3  trackbacks - 0
<2009年3月>
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

常用链接

留言簿(2)

随笔分类

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜

错误一:

HTTP Status 500 -


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: could not execute query
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

 

root cause

org.hibernate.exception.GenericJDBCException: could not execute query
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
org.hibernate.loader.Loader.doList(Loader.java:2148)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
org.hibernate.loader.Loader.list(Loader.java:2024)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1106)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
com.lyg.dao.MessageDAO.findAll(MessageDAO.java:142)
com.lyg.service.MessageService.findAll(MessageService.java:15)
com.lyg.struts.action.MessageAction.doAdd(MessageAction.java:43)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

 note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.



        以上是耗了一上午解决的错误提示,原来从数据库返回一数据时还是成功的,只是显示不了时间信息,后面在页面中迭代就出现这问题,奇怪的是数据库操作成功。开始检查源码,Struts,Hibernate不存在配置问题,估计问题不于此,hql也肯定没问题,想必在于GenericJDBCException,于是便google一下能解决不。。。网上这样的解决方法形形色色,但始终解决不了;后来请教我的高手老大,一经观察调试,原来是数据库数据存在问题,因mysql表列里某些Date(timestamp)类型数据为“0000-00-00 00:00”(之前insert赋空值时自动生成),但Hql取出对象数据迭代时就出现以上问题!从数据库表中的错误信息删除便完美地解决问题!(当然,出现类似问题可能存在其他因素,我这只是就本人出现的问题作解决,同时帮助遇到这方面问题的朋友)。
        不断开发,不断发现问题解决问题。。。有空不断补充总结


以下转自他人的:
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: src\hibernate.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>

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


4.      错误:

Exception in thread "main" org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update

原因与解决:

    因为Hibernate Tools(或者Eclipse本身的Database Explorer)生成*.hbn.xml工具中包含有catalog="***"*表示数据库名称)这样的属性,将该属性删除就可以了




5.      错误:

org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations)

原因与解决:
方法1 删除Set方的cascade
方法2 解决关联关系后,再删除
方法3 many-to-one方增加cascade 但值不能是none
最后一招:
检查一下
hashCode equals是否使用了id作为唯一标示的选项了;我用uuid.hex时是没有问题的;但是用了native,就不行了,怎么办?删除啊!

这个错误可以参见我的blog文章:
http://www.blogjava.net/crazycy/archive/2006/06/24/54939.html

6.      错误:

exception javax.servlet.ServletException: BeanUtils.populat

root cause

java.lang.IllegalArgumentException:Cannot invoke ***Form.set*** - argument type mismatch

原因

      这个问题很奇怪的说,为啥说奇怪呢?

      先说问题的原因:问题发生如下两种情况:

*         Form中是Date类型

*         上传文件时

为什么说奇怪呢?主要针对Form是日期型的来说的;因为我做过N多系统Form中都是用java.util.Date,界面使用<html:text property=”date”/>;都是没有问题的。所以第一次遇到这个错误时,捣鼓了一个下午。

解决:

第一个问题:你把Date换成String;在Action中进行转换;当然转换要借助于SimpleDateFormate方法喽

第二个问题:记得在form中增加enctype="multipart/form-data" 呵呵


7.      问题:

今天用Tomcat5.5.12,发现原来很好用的系统不能用了,反复测试发现页面中不能包含 taglib,否则会出现以下提示:

HTTP Status 500 -type Exception report

Message  

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /index.jsp(1,1) Unable to read TLD "META-INF/tlds/struts-bean.tld" from JAR file "file:*****/WEB-INF/lib/struts.jar":

原因:

更新了工程用的lib文件夹下的jar,发布时也发布了servlet.jarjsp-api.jar

解决:

jsp-api.jar删除就解决这个问题了。


8.      问题:Tomcat5.0.20中差错可以通过[Tomcat安装目录]/logs下的localhost_log.2006-07-14.txt类似的文件看具体的错误日志,但是在5.5中就找不到了

原因与解决:

我把[Tomcat安装目录]/bin下的tomcat5w.exelogging标签捣鼓了一会,然后重起就有了。

原因具体说不准,用非安装版也有这个问题。

最终解决方案:
   http://tomcat.apache.org/tomcat-5.5-doc/logging.html

posted on 2009-03-05 14:50 圣克尔·光 阅读(3082) 评论(0)  编辑  收藏 所属分类: SSH

只有注册用户登录后才能发表评论。


网站导航: