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

          常用鏈接

          留言簿

          隨筆檔案

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          做一個(gè)web項(xiàng)目,啟動(dòng)tomcat時(shí)遇到了這樣一個(gè)錯(cuò)誤:

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

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

          posted @ 2009-08-12 23:37 田園風(fēng)光 閱讀(422) | 評(píng)論 (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)勢了,對(duì)于開發(fā)不是很方便,干脆還是不改吧。這種錯(cuò)誤不用理會(huì).  

          報(bào)錯(cuò)原理:

           

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


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

           

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

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

          出現(xiàn)了錯(cuò)誤異常:
          信息: 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)

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

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


           

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

          出現(xiàn)的錯(cuò)誤異常:
          嚴(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)光 閱讀(435) | 評(píng)論 (0)編輯 收藏

          今天晚上把三個(gè)框架整合在一起出現(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 提示錯(cuò)誤信息
          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
           

          因?yàn)樽约簺]有把struts.xml的文件配置好,沒有引入struts-default.xml的原因。

          posted @ 2009-07-25 01:08 田園風(fēng)光 閱讀(1201) | 評(píng)論 (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('請(qǐng)輸入內(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)光 閱讀(1234) | 評(píng)論 (1)編輯 收藏
          在使用jstl標(biāo)簽的出現(xiàn)了這樣的異常:java.lang.NoSuchFieldError: deferredExpression
          原因是:在lib目錄下出現(xiàn)了連個(gè)不同版本的jstl標(biāo)簽。
          解決方法:把就版本的jstl刪除就可以了啊!
          posted @ 2009-07-18 22:29 田園風(fēng)光 閱讀(444) | 評(píng)論 (0)編輯 收藏
          主站蜘蛛池模板: 双桥区| 龙州县| 壤塘县| 呼图壁县| 南丰县| 攀枝花市| 永兴县| 洛宁县| 南城县| 怀安县| 和田县| 凤凰县| 盐城市| 手机| 延长县| 文登市| 芮城县| 宜宾市| 休宁县| 玛曲县| 昌邑市| 桐梓县| 常熟市| 新邵县| 岐山县| 舒兰市| 普陀区| 临邑县| 古田县| 沙洋县| 平江县| 郓城县| 宁德市| 英山县| 烟台市| 孙吴县| 新疆| 密山市| 安国市| 横山县| 仙桃市|