wood burning stoves 2.0*
The moose likes Struts and the fly likes Unable to load configuration-struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Unable to load configuration-struts2" Watch "Unable to load configuration-struts2" New topic
Author

Unable to load configuration-struts2

Romeo Ranjan
Ranch Hand

Joined: Feb 23, 2009
Posts: 95
Hi
I am trying to work out struts tutorial.I use struts2.This is the tutorial link that I followed http://devtalks.blogspot.com/2009/07/eclipse-galileo-and-struts2.html
Below is the exception I get.My struts.xml file is in Web-inf/classes folder.I have included the jar file in the web-inf/lib folder.The list of jar files are

1.commons-fileupload-1.2.1.jar
2.commons-io-1.3.2.jar
3.commons-logging-1.0.4.jar
4.freemarker-2.3.15.jar
5.ognl-2.7.3.jar
6.struts2-core-2.1.8.1.jar
7.xwork-core-2.1.6.jar



SCJP 6.0
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 643
What does your struts.xml file look like?
Romeo Ranjan
Ranch Hand

Joined: Feb 23, 2009
Posts: 95


This is how my struts.xml look like.
Lorand Komaromi
Ranch Hand

Joined: Oct 08, 2009
Posts: 276
The error message says clearly that your doctype is messed up:

Caused by: Document root element "struts", must match DOCTYPE root "unspecified".


The correct doctype:



Your root element is "struts", not "unnamed"...


OCJP 6 (93%)
Romeo Ranjan
Ranch Hand

Joined: Feb 23, 2009
Posts: 95
Thanks a lot,now it works.I want to know how did you learn to solve these errors in struts,is it by experience?
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 643
Romeo Ranjan wrote:Thanks a lot,now it works.I want to know how did you learn to solve these errors in struts,is it by experience?

Well, how did you know to create your doctype with the word "unspecified"?
Lorand Komaromi
Ranch Hand

Joined: Oct 08, 2009
Posts: 276
Romeo Ranjan wrote:I want to know how did you learn to solve these errors in struts,is it by experience?


The logs are a good starting point when debugging, in many cases (like this one) they pinpoint the cause. It's not rocket science, really...
 
wood burning stoves
 
subject: Unable to load configuration-struts2