This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts 2 error - Unable to load configuration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 error - Unable to load configuration" Watch "Struts 2 error - Unable to load configuration" New topic
Author

Struts 2 error - Unable to load configuration

Kunal Sathe
Ranch Hand

Joined: Apr 08, 2005
Posts: 49
Hello,

We are in the process of enhancing an existing struts 1 application with new functionality that uses struts 2.
We are seeing the following errors. Can someone help?

Thanks,
Kunal

Unable to load configuration. - package - file:/c:/clients/PSWD/eclipse/msc_workspace/PSWDBase/WebContent/WEB-INF/classes/struts.xml:14:71
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:48)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:221)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:302)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:78)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3635)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4222)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: The package name 'com.mccamish.actions.rpm' at location package - file:/c:/clients/PSWD/eclipse/msc_workspace/PSWDBase/WebContent/WEB-INF/classes/struts.xml:14:71 is already been used by another package at location package - file:/C:/clients/PSWD/eclipse/msc_workspace/PSWDBase/WebContent/WEB-INF/classes/struts.xml:14:71 - package - file:/c:/clients/PSWD/eclipse/msc_workspace/PSWDBase/WebContent/WEB-INF/classes/struts.xml:14:71
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.addPackageConfig(DefaultConfiguration.java:113)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:467)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:265)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:189)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
... 22 more
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Can you post your struts.xml?
Kunal Sathe
Ranch Hand

Joined: Apr 08, 2005
Posts: 49
Here you go:

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

And you're sure it's not being deployed twice somewhere/how?
Kunal Sathe
Ranch Hand

Joined: Apr 08, 2005
Posts: 49
Yes David. I am sure it is not being deployed twice. However, I must tell you that parts of this project use struts 1 while some parts use struts 2
Do you think this may have to do with having some unnecessary jar files in the build path?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I don't think so, although I've never done that in real life.

The other thing that confuses me is the error message itself... did you try just using "spring" as the object factory name? I'm wondering if it's a Spring config issue, since the package name in the error doesn't even appear in the struts.xml file.
Kunal Sathe
Ranch Hand

Joined: Apr 08, 2005
Posts: 49
David, sorry about the confusion. The latest version of the struts.xml file does have the package name in it.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'm assuming the quote is a typo.

Use a different package name.
Kunal Sathe
Ranch Hand

Joined: Apr 08, 2005
Posts: 49
David, Actually the quote is not a typo. I have tried changing the package name to something else and that has not worked too.
Kunal Sathe
Ranch Hand

Joined: Apr 08, 2005
Posts: 49
Oops, I meant the word quote in the struts.xml is not a typo
The symbol ' in the package name is a typo. Sorry, I did not read your post carefully.
Kunal Sathe
Ranch Hand

Joined: Apr 08, 2005
Posts: 49
David, I have fixed the issue. There was a duplicate struts.xml file in my workspace. Thanks for your help!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Deployed twice ;)

Although usually it's that someone put a Struts 2 jar in the application server share library.
Micheal Makalo
Greenhorn

Joined: Aug 14, 2012
Posts: 1
I have the same problem too..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 2 error - Unable to load configuration
 
Similar Threads
Can I access the value of a listKey in <s:select> from my Action Class?
Error filterStart ... Struts2
Does Eclipse Ganymede create a class file automatically
Exception in struts2 server startup
Struts 2 Starting Problem