Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to load configuration-struts2

 
Romeo Ranjan
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does your struts.xml file look like?
 
Romeo Ranjan
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This is how my struts.xml look like.
 
Lorand Komaromi
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"...
 
Romeo Ranjan
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic