警告: couldn't clear tomcat cache


最近在項目中實現一個文件傳輸功能時,每完成一次操作tomcat8中總是拋出如下異常:

 

警告: couldn't clear tomcat cache
java.lang.NoSuchFieldException: resourceEntries
    at java.lang.Class.getDeclaredField(Unknown Source)
    at com.opensymphony.xwork2.util.LocalizedTextUtil.clearMap(LocalizedTextUtil.java:735)
    at com.opensymphony.xwork2.util.LocalizedTextUtil.clearTomcatCache(LocalizedTextUtil.java:719)
    at com.opensymphony.xwork2.util.LocalizedTextUtil.reloadBundles(LocalizedTextUtil.java:703)
    at com.opensymphony.xwork2.util.LocalizedTextUtil.findDefaultText(LocalizedTextUtil.java:178)
    at com.opensymphony.xwork2.util.LocalizedTextUtil.getDefaultMessage(LocalizedTextUtil.java:579)
    at com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:461)
    at com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:293)
    at org.apache.struts2.interceptor.FileUploadInterceptor.getTextMessage(FileUploadInterceptor.java:368)
    at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:277)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
    at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
    at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
    at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)

 

雖然不影響使用,but maybe it is a time bomb! 於是決定找出原因。搜索了一番,發現解決方案大概有兩種:

方案一:

因為tomcat8沒有屬性resourceEntries,換成tomcat7就好了。但是從tomcat8==>tomcat7感覺在退步,果斷拒絕此方法。

參考鏈接:http://blog.csdn.net/findbestoy/article/details/50756465

 

方案二:

升級struts版本,struts2.0.9==>struts2.3.20,完美解決問題,堅決采納本方法!

struts2.3.20下載地址:http://download.csdn.net/detail/xyznad/9486393

參考鏈接:http://blog.csdn.net/bigtree_3721/article/details/50866958

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM