期待更好更穩定的開源FrameWork的出現,讓我們一起努力吧! |
|
|||
日歷
統計
導航常用鏈接留言簿(1)隨筆分類隨筆檔案(42)
文章檔案(37)
相冊搜索積分與排名
最新隨筆
最新評論
閱讀排行榜
評論排行榜
|
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 或者: type Status report message Servlet action is not available description The requested resource (Servlet action is not available) is not available.
3. 錯誤 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception java.lang.ClassNotFoundException: 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)
原因與解決: 這個錯誤可以參見我的blog文章: 6. 錯誤: exception javax.servlet.ServletException: BeanUtils.populat root cause java.lang.IllegalArgumentException:Cannot invoke ***Form.set*** - argument type mismatch 原因 這個問題很奇怪的說,為啥說奇怪呢? 先說問題的原因:問題發生如下兩種情況:
為什么說奇怪呢?主要針對Form是日期型的來說的;因為我做過N多系統Form中都是用java.util.Date,界面使用<html:text property=”date”/>;都是沒有問題的。所以第一次遇到這個錯誤時,搗鼓了一個下午。 解決: 第一個問題:你把Date換成String;在Action中進行轉換;當然轉換要借助于SimpleDateFormate方法嘍 第二個問題:記得在form中增加enctype="multipart/form-data" 呵呵
7. 問題: 今天用Tomcat 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.jar和jsp-api.jar。 解決: 把jsp-api.jar刪除就解決這個問題了。 8. 問題:Tomcat 原因與解決: 我把[Tomcat安裝目錄]/bin下的tomcat5w.exe的logging標簽搗鼓了一會,然后重起就有了。 原因具體說不準,用非安裝版也有這個問題。 最終解決方案: |
![]() |
|
Copyright © BlueSky_itwangxinli | Powered by: 博客園 模板提供:滬江博客 |