1

I am trying to include a jar in my struts2 project so that its actions are available to use in my main project. After adding the line

struts.convention.action.includeJars=.*?survey.*?

to my struts.properties and trying to redeploy to Tomcat with Maven, I get the errors:

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)

and down the trace a bit further:

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)

I've seen in other posts that this is because it can't find the struts.xml because there are two struts.xml files - one in my main project, and another in the jar that I am including. Is there some way to exclude that dependency struts.xml if that is the issue? Or is this related to something else altogether?

Removing the includeJars line allows me to deploy my app, but I can't access the actions in the jar that is being included.

eipark
  • 7,442
  • 3
  • 24
  • 33

1 Answers1

0

Make sure you have the bean-scope interceptor in your struts.xml, and also as a dependency in your pom.xml.

eipark
  • 7,442
  • 3
  • 24
  • 33