我正在尝试在我的 struts2 项目中包含一个 jar,以便在我的主项目中可以使用它的操作。添加行后
struts.convention.action.includeJars=.*?survey.*?
到我的 struts.properties 并尝试使用 Maven 重新部署到 Tomcat,我收到错误:
WARN InterceptorBuilder 14 Nov 2012 09:58:09: Unable to load config class com.googlecode.scopeplugin.ScopeInterceptor at interceptor - jar:file:/other/dev/survey/webapp/target/survey-4.4-RC11-SNAPSHOT/WEB-INF/lib/survey-controller-4.4-RC11-SNAPSHOT.jar!/struts.xml:12:91 probably due to a missing jar, which might be fine if you never plan to use the bean-scope interceptor
ERROR InterceptorBuilder 14 Nov 2012 09:58:09: Actual exception
Caught Exception while registering Interceptor class com.googlecode.scopeplugin.ScopeInterceptor - interceptor - jar:file:/other/dev/survey/webapp/target/survey-4.4-RC11-SNAPSHOT/WEB-INF/lib/survey-controller-4.4-RC11-SNAPSHOT.jar!/struts.xml:12:91
at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:214)
at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70)
at org.apache.struts2.convention.DefaultInterceptorMapBuilder.buildInterceptorList(DefaultInterceptorMapBuilder.java:99)
再往下走一点:
ERROR Dispatcher 13 Nov 2012 17:37:13: Dispatcher initialization failed
Unable to load configuration. - [unknown location]
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:436)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
我在其他帖子中看到这是因为它找不到 struts.xml,因为有两个 struts.xml 文件 - 一个在我的主项目中,另一个在我包含的 jar 中。如果这是问题,有什么方法可以排除依赖 struts.xml 吗?或者这完全与其他事情有关?
删除 includeJars 行允许我部署我的应用程序,但我无法访问正在包含的 jar 中的操作。