做一个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 田园风光 阅读(418) |
评论 (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 田园风光 阅读(836) |
评论 (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 中即可解决该问题。
解决这两个异常可以将 MySQL 的驱动文件从 WEB-INF\lib 文件夹中移动到 %TOMCAT_HOME%\lib 中。
引自:http://www.blogjava.net/cmzy/archive/2009/03/25/261884.html
posted @
2009-07-26 01:11 田园风光 阅读(952) |
评论 (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 田园风光 阅读(427) |
评论 (0) |
编辑 收藏