struts配置 filter-class

2020-12-30 17:38:50 浏览数 (1)

SEVERE: Exception starting filter struts2 java.lang.InstantiationError: com.opensymphony.xwork2.util.finder.ClassFinder at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:390) at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:347) at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:206) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66) at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:957) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:463) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:496) at org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:73) at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:61) at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382) at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:103) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1362) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1451) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:296) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374) at org.apache.catalina.core.ContainerBase ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)atorg.apache.catalina.core.ContainerBase C o n t a i n e r B a c k g r o u n d P r o c e s s o r . p r o c e s s C h i l d r e n ( C o n t a i n e r B a s e . j a v a : 1530 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . C o n t a i n e r B a s e ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530) at org.apache.catalina.core.ContainerBaseContainerBackgroundProcessor.processChildren(ContainerBase.java:1540) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519) at java.lang.Thread.run(Thread.java:722)

配置文件web.xml报错,排除没有引入struts包,maven的包也引入了,应该是struts版本不一样,这个<filter-class>的路径不一样,ctrl shift T,查一下这个StrutsPrepareAndExecuteFilter类,原来在这个位置,重新改一下。

试了一下,好像又不行。

代码语言:javascript复制
<filter-class>
         org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
</filter-class>

然后还是报错,怀疑是包冲突,然后把maven仓库下struts的core删除,重新update maven project,再clean,最好可以了。

0 人点赞