When a file transfer function is recently implemented in a project, the following exception is always thrown in tomcat8 for each completed operation:
warning: 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)
While not affecting use, but maybe it is a time bomb! and decided to find out why. After searching, we found that there are probably two solutions:
Programme one:
Because Tomcat8 has no attribute resourceentries, it is better to change to TOMCAT7. But from tomcat8==>tomcat7 feeling in a setback, decisively rejecting this method.
Reference Link: http://blog.csdn.net/findbestoy/article/details/50756465
Scenario Two:
Upgrade struts version, struts2.0.9==>struts2.3.20, perfect problem solving, resolutely adopt this method!
struts2.3.20:http://download.csdn.net/detail/xyznad/9486393
Reference Link: http://blog.csdn.net/bigtree_3721/article/details/50866958
Warning: couldn ' t clear tomcat cache