为了账号安全,请及时绑定邮箱和手机立即绑定

<interceptor-ref name="defaultStackz"></interceptor-ref>的问题

一直报错

严重: Exception starting filter struts2
Unable to load configuration. - interceptor-ref - file:/C:/Documents%20and%20Settings/Administrator/Workspaces/MyEclipse%20Professional%202014/.metadata/.me_tcat7/webapps/struts-timerInterceptor/WEB-INF/classes/struts.xml:19:42
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:501)
    at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
    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.<init>(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.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: Unable to load configuration. - interceptor-ref - file:/C:/Documents%20and%20Settings/Administrator/Workspaces/MyEclipse%20Professional%202014/.metadata/.me_tcat7/webapps/struts-timerInterceptor/WEB-INF/classes/struts.xml:19:42
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:445)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:489)
    ... 19 more
Caused by: Unable to find interceptor class referenced by ref-name defaultStackz - interceptor-ref - file:/C:/Documents%20and%20Settings/Administrator/Workspaces/MyEclipse%20Professional%202014/.metadata/.me_tcat7/webapps/struts-timerInterceptor/WEB-INF/classes/struts.xml:19:42
    at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:63)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1110)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildInterceptorList(XmlConfigurationProvider.java:626)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:440)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:552)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:292)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:258)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
    ... 21 more

后来没办法把这句话删除了才能运行。这是为啥?

正在回答

4 回答

这段代码是必须的,不然会一直报错!有大神能解释一下吗?

0 回复 有任何疑惑可以回复我~

是老师的坑好吗?传上来的代码。

0 回复 有任何疑惑可以回复我~

我好像知道怎么错了。

<interceptor-ref name="defaultStackz"></interceptor-ref>

defaultStack多加了一个z  。

自己被自己气的没话说。 感谢点进来看的小伙伴们 就当错一个教训吧。大家不要烦这样的错误啊。

0 回复 有任何疑惑可以回复我~

Caused by: Unable to find interceptor class referenced by ref-name defaultStackz - interceptor-ref

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

<interceptor-ref name="defaultStackz"></interceptor-ref>的问题

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信