做一個web項目,啟動tomcat時遇到了這樣一個錯誤:
嚴重: Exception loading sessions from persistent storage
java.io.WriteAbortedException: writing aborted,java.io.NotSerializableException: ...
解決:對象要必須實現java.io.Serializable接口;
posted @
2009-08-12 23:37 田園風光 閱讀(422) |
評論 (0) |
編輯 收藏
信息: Illegal access: this web application instance has been stopped already. Could not load java.net.BindException. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1244)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at com.mysql.jdbc.CommunicationsException.<init>(CommunicationsException.java:155)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2723)
解決辦法:
將tomcat的server.xml中的Context的reloadable設成false。
比如:<Context path="/expert" docBase="expert" debug="0" reloadable="false">
解決辦法也容易,只要把tomcat的server.xml 中的reloadable="true" 改成false就行了,不過這樣做就失去了熱部署的優勢了,對于開發不是很方便,干脆還是不改吧。這種錯誤不用理會.
報錯原理:
原因是因為在tomcat重啟的時候,因為之前的tomcat中的線程還沒有完全關閉,新啟動tomcat就會報這個異常,不過這個不影響正常使用,只是跳個異常挺煩人的。使用過hibernate, spring或其他大型組件,當一個WEB應用系統中有很多類時,如果開啟了Tomcat的reloadable=true,那么每當相關文件改變時, Tomcat會停止web app并釋放內存,然后重新加載web app.這實在是個浩大的工程。所以我們總是在想如果能有只重載某幾個類的功能,將極大的滿足了我們的調試。
當response.sendRedirect("xxxx"); 時,而客戶端關閉了瀏覽器,就會出這種錯.
并非程序錯誤.
引自:http://blog.csdn.net/m232341339/archive/2008/11/01/3201104.aspx
posted @
2009-07-26 01:26 田園風光 閱讀(842) |
評論 (0) |
編輯 收藏
出現了錯誤異常:
信息: Illegal access: this web application instance has been stopped already. Could not load java.net.BindException. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at com.mysql.jdbc.SQLError.createLinkFailureMessageBasedOnHeuristics(SQLError.java:1220)
at com.mysql.jdbc.CommunicationsException.<init>(CommunicationsException.java:51)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1070)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3270)
at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1659)
at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4296)
at com.mysql.jdbc.ConnectionImpl.cleanup(ConnectionImpl.java:1265)
at com.mysql.jdbc.ConnectionImpl.finalize(ConnectionImpl.java:2667)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
在啟動 tomcat ,并發布應用后沒有問題,但是如果重新發布就出現如下異常:
this web application instance has been stopped already. Could not load java.net.BindException
this web application instance has been stopped already. Could not load com.mysql.jdbc
這是由于 MySQL 的 JDBC 驅動放在應用的 WEB-INF\lib 目錄下,在重新發布時其加載了兩次,故只要將其拷貝到 TOMCAT_HOME%\lib 中即可解決該問題。
解決這兩個異??梢詫?/span> MySQL 的驅動文件從 WEB-INF\lib 文件夾中移動到 %TOMCAT_HOME%\lib 中。
引自:http://m.tkk7.com/cmzy/archive/2009/03/25/261884.html
posted @
2009-07-26 01:11 田園風光 閱讀(958) |
評論 (0) |
編輯 收藏
出現的錯誤異常:
嚴重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
原因:spring和hibernate的包不兼容,asm.jar(hibernate)和asm-2.2.3.jar(spring)
解決辦法:將asm-2.2.3.jar刪除
posted @
2009-07-26 00:16 田園風光 閱讀(435) |
評論 (0) |
編輯 收藏