隨筆 - 9  文章 - 4  trackbacks - 0
          <2009年7月>
          2829301234
          567891011
          12131415161718
          19202122232425
          2627282930311
          2345678

          常用鏈接

          留言簿

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          做一個web項目,啟動tomcat時遇到了這樣一個錯誤:

           嚴(yán)重: Exception loading sessions from persistent storage 
          java.io.WriteAbortedException: writing aborted,java.io.NotSerializableException: ...

          解決:對象要必須實現(xiàn)java.io.Serializable接口;

          posted @ 2009-08-12 23:37 田園風(fēng)光 閱讀(423) | 評論 (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設(shè)成false。
          比如:<Context path="/expert" docBase="expert" debug="0" reloadable="false">

           

          解決辦法也容易,只要把tomcat的server.xml 中的reloadable="true" 改成false就行了,不過這樣做就失去了熱部署的優(yōu)勢了,對于開發(fā)不是很方便,干脆還是不改吧。這種錯誤不用理會.  

          報錯原理:

           

          原因是因為在tomcat重啟的時候,因為之前的tomcat中的線程還沒有完全關(guān)閉,新啟動tomcat就會報這個異常,不過這個不影響正常使用,只是跳個異常挺煩人的。使用過hibernate, spring或其他大型組件,當(dāng)一個WEB應(yīng)用系統(tǒng)中有很多類時,如果開啟了Tomcat的reloadable=true,那么每當(dāng)相關(guān)文件改變時, Tomcat會停止web app并釋放內(nèi)存,然后重新加載web app.這實在是個浩大的工程。所以我們總是在想如果能有只重載某幾個類的功能,將極大的滿足了我們的調(diào)試。


            當(dāng)response.sendRedirect("xxxx");   時,而客戶端關(guān)閉了瀏覽器,就會出這種錯.    
            并非程序錯誤.

           

          引自:http://blog.csdn.net/m232341339/archive/2008/11/01/3201104.aspx

          posted @ 2009-07-26 01:26 田園風(fēng)光 閱讀(844) | 評論 (0)編輯 收藏

          出現(xiàn)了錯誤異常:
          信息: 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 ,并發(fā)布應(yīng)用后沒有問題,但是如果重新發(fā)布就出現(xiàn)如下異常:

          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 驅(qū)動放在應(yīng)用的 WEB-INF\lib 目錄下,在重新發(fā)布時其加載了兩次,故只要將其拷貝到 TOMCAT_HOME%\lib 中即可解決該問題。

          解決這兩個異常可以將 MySQL 的驅(qū)動文件從 WEB-INF\lib 文件夾中移動到 %TOMCAT_HOME%\lib 中。


           

          引自:http://www.aygfsteel.com/cmzy/archive/2009/03/25/261884.html
          posted @ 2009-07-26 01:11 田園風(fēng)光 閱讀(959) | 評論 (0)編輯 收藏

          出現(xiàn)的錯誤異常:
          嚴(yán)重: 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 田園風(fēng)光 閱讀(436) | 評論 (0)編輯 收藏

          今天晚上把三個框架整合在一起出現(xiàn)了一些異常:
          log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
          log4j:WARN Please initialize the log4j system properly.
          2009-7-25 0:31:38 org.apache.catalina.core.StandardContext filterStart
          嚴(yán)重: Exception starting filter struts2
          [unknown location]
           at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:835)
           at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:131)
           at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:100)
           at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:130)
           at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
           at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
           at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
           at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:205)
           at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
           at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
           at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
           at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
           at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363)
           at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
           at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
           at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
           at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
           at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
           at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
           at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
           at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
           at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
           at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
           at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
           at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
           at org.apache.catalina.core.StandardService.start(StandardService.java:516)
           at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
           at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
           at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
          Caused by: Premature end of file. - [unknown location]
           at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:123)
           at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:830)
           ... 34 more
          Caused by: org.xml.sax.SAXParseException: Premature end of file.
           at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
           at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
           at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
           at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
           at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
           at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
           at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
           at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
           at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
           at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
           at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
           at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
           at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:121)
           ... 35 more
          2009-7-25 0:31:38 org.apache.catalina.core.StandardContext start
          嚴(yán)重: Error filterStart
          2009-7-25 0:31:38 org.apache.catalina.core.StandardContext start
          嚴(yán)重: Context [/ssh] startup failed due to previous errors
          2009-7-25 0:31:38 org.apache.catalina.core.ApplicationContext log

          使用log4j.properties 提示錯誤信息
          2009-07-25 01:02:05 [org.springframework.web.context.ContextLoader]-[INFO] Root WebApplicationContext: initialization started
           2009-07-25 01:02:05 [org.springframework.web.context.support.XmlWebApplicationContext]-[INFO] Refreshing org.springframework.web.context.support.XmlWebApplicationContext@19bd735: display name [Root WebApplicationContext]; startup date [Sat Jul 25 01:02:05 CST 2009]; root of context hierarchy
           2009-07-25 01:02:05 [org.springframework.beans.factory.xml.XmlBeanDefinitionReader]-[INFO] Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
           2009-07-25 01:02:06 [org.springframework.web.context.support.XmlWebApplicationContext]-[INFO] Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext@19bd735]: org.springframework.beans.factory.support.DefaultListableBeanFactory@146df77
           2009-07-25 01:02:06 [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[INFO] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@146df77: defining beans []; root of factory hierarchy
           2009-07-25 01:02:06 [org.springframework.web.context.ContextLoader]-[INFO] Root WebApplicationContext: initialization completed in 1469 ms
           2009-07-25 01:02:07 [com.opensymphony.xwork2.config.providers.XmlConfigurationProvider]-[INFO] Parsing configuration file [struts-default.xml]
           2009-07-25 01:02:07 [com.opensymphony.xwork2.config.providers.XmlConfigurationProvider]-[INFO] Parsing configuration file [struts-plugin.xml]
           2009-07-25 01:02:07 [com.opensymphony.xwork2.util.DomHelper]-[FATAL] Premature end of file. at (null:-1:-1)
           org.xml.sax.SAXParseException: Premature end of file.
          2009-07-25 01:02:07 [org.springframework.web.context.support.XmlWebApplicationContext]-[INFO] Closing org.springframework.web.context.support.XmlWebApplicationContext@19bd735: display name [Root WebApplicationContext]; startup date [Sat Jul 25 01:02:05 CST 2009]; root of context hierarchy
           2009-07-25 01:02:07 [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[INFO] Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@146df77: defining beans []; root of factory hierarchy
           

          因為自己沒有把struts.xml的文件配置好,沒有引入struts-default.xml的原因。

          posted @ 2009-07-25 01:08 田園風(fēng)光 閱讀(1202) | 評論 (3)編輯 收藏
          //取fck內(nèi)容的長度
          function GetLength(str)
          {
              var oEditor = FCKeditorAPI.GetInstance(str) ;
              var checkContent= oEditor.EditorDocument ;
              var contentLength ;

              if ( document.all )       
              {
                  contentLength= checkContent.body.innerText.trim().length ;
              }
              else                   
              {
                  var r = checkContent.createRange() ;
                  r.selectNodeContents( checkContent.body ) ;
                  contentLength= r.toString().trim().length ;
              }
          return contentLength
          }  

          //判斷是不是為空
          function CheckPost(){
              if(GetLength("content")<=0)    //content為FCKeditor在頁面所設(shè)的名字
              {
                  alert('請輸入內(nèi)容');       
                  return false;
              }
          }

          //取fck內(nèi)容
          function GetContent(str)
          {
               var oEditor = FCKeditorAPI.GetInstance(str) ;
               return oEditor.GetXHTML();
          }  

          //去掉字符串的空格
          String.prototype.trim = function()
          {
                       return this.replace(/(^[\s]*)|([\s]*$)/g, "");
          }
          posted @ 2009-07-23 19:37 田園風(fēng)光 閱讀(1235) | 評論 (1)編輯 收藏
          在使用jstl標(biāo)簽的出現(xiàn)了這樣的異常:java.lang.NoSuchFieldError: deferredExpression
          原因是:在lib目錄下出現(xiàn)了連個不同版本的jstl標(biāo)簽。
          解決方法:把就版本的jstl刪除就可以了啊!
          posted @ 2009-07-18 22:29 田園風(fēng)光 閱讀(445) | 評論 (0)編輯 收藏
               摘要:   閱讀全文
          posted @ 2009-07-10 20:08 田園風(fēng)光 閱讀(288) | 評論 (0)編輯 收藏
          主站蜘蛛池模板: 泰州市| 邹平县| 稻城县| 阳泉市| 奈曼旗| 保定市| 泸溪县| 大理市| 新民市| 扶沟县| 儋州市| 凤庆县| 留坝县| 尼木县| 通道| 定边县| 辛集市| 牟定县| 吐鲁番市| 东乡| 瑞丽市| 慈利县| 泉州市| 马鞍山市| 盘锦市| 长子县| 会同县| 漳浦县| 外汇| 琼中| 周宁县| 奇台县| 龙岩市| 石渠县| 昌乐县| 聂拉木县| 额济纳旗| 凤城市| 凌源市| 枣庄市| 乐清市|