zoukankan      html  css  js  c++  java
  • 警告: 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

  • 相关阅读:
    vue项目搭建
    js监听input输入框值的实时变化实例
    nodejs-Child Process模块
    nodejs-Express框架
    前端的存储技术cookie、sessionStorage、localStorage
    node.js之path
    css两列自适应布局的多种实现方式及原理。
    React jQuery公用组件开发模式及实现
    js创建对象的几种方式
    IE9 不F12打开控制台,代码不执行。打开后正常
  • 原文地址:https://www.cnblogs.com/bobshieh/p/5373793.html
Copyright © 2011-2022 走看看