June 26, 2011

Unable to load configuration - action - struts.xml

Topic: Struts 2.1.8.1

Application Server: JBoss 4.2.2 GA

Exception:

INFO  [STDOUT] 08:42:44,593 ERROR [Dispatcher] Dispatcher initialization failed
Unable to load configuration. - action - file:/C:/jboss-4.2.2.GA/jboss-4.2.2.GA/server/default/tmp/deploy/tmp6158064408942958403Struts2Demonstration-exp.war/WEB-INF/classes/struts.xml:16:74
 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
 at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374)
 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418)
 at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
 at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
 at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
 at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:108)
 at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3722)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4367)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Resolution:

The Struts 2 framework has dependencies on the following distributables:

- commons-fileupload-1.2.1.jar
- commons-io-1.3.2.jar
- commons-logging-1.0.4.jar
- commons-logging-api-1.1.jar
- freemarker-2.3.15,jar
- log4j-1.2.14.jar
- ognl-2.7.3.jar
- xwork-core-2.1.6.jar

Adding these jars to the WEB-INF/lib folder of the web application resolves this error. All these jars as as well as the Struts distribution may be downloaded from this link

1 comment: