• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Unable to load configuration-struts2

 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


This is how my struts.xml look like.
 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic