• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Understanding SAX parse error message

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to get my first Struts webapp going, converting an existing tiny non-Struts webapp to Struts. I've quickly come to the conclusion that I have a LOT more to learn, in part because I can't even understand the error message I'm getting. When I look in Tomcat's stderr log, I see this org.xml.sax.SAXParseException error:


SEVERE: Parse Error at line 35 column 17: The content of element type "struts-config" must match "(display-name?,description?,data-sources?,form-beans?,global-exceptions?, global-forwards?,action-mappings?,controller?,message-resources*,plug-in*)".



Okay, so there's something wrong with my struts-config.xml file, I get that. What I don't understand are the "?" and "*" after each of the items listed. Does "?" mean "this one is optional" while "*" means "you can have 0 or more of these"? Or does the "?" mean "this is missing"?

A journey of a thousand miles generally begins with a mysterious error message.
 
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
those are in the struts config DTD and are DTD syntax. * means 0 to n occurences, ? means 0 or 1 occurence. the complete systax is here: http://www.linuxfromscratch.org/alfs/view/dtd/alfs_dtd/xml_dtd-syntax.html.

it looks like you mixed up the order of of of the struts elements. make sure they are in the correct order shown in the error (display-name...plugin).
 
Wally Hartshorn
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks! I've got it figured out now -- and actually working! (Woohoo!)
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic