Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

struts-config.xml file errors

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Could any one point out whats wrong with my struts-config file..I always get the following excepetions

-------
[CODE]
09:52:50,741 ERROR [Digester] Parse Error at line 85 column 17: The content of e
lement type "struts-config" must match "(data-sources?,form-beans?,global-except
ions?,global-forwards?,action-mappings?,controller?,message-resources*,plug-in*)
".
org.xml.sax.SAXParseException: The content of element type "struts-config" must
match "(data-sources?,form-beans?,global-exceptions?,global-forwards?,action-map
pings?,controller?,message-resources*,plug-in*)".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
known Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown S
ource)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)

at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow
n Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
Dispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
known Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
[CODE]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see anything obvious. Finding XML clerical errors can be a real hassle. Here's a technique I'd recommend:

  • Make a copy of your current struts-config.xml
  • Replace the current struts-config.xml file with the empty one that comes with the struts download.
  • restart the application to see that there are no parsing errors
  • One at a time, replace each <form-bean> tag and any corresponding <action> tags from your copied file, restarting the application each time.


  • After following this process, you should know where the problem is.
     
    shailesh kumar
    Ranch Hand
    Posts: 36
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks Merrill !!
     
    shailesh kumar
    Ranch Hand
    Posts: 36
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I think I found the problem , its bcz I was closing </action-mapping> tag after each <action> tag. There shud be only one start and end of <action-mapping> tag.
     
    Ranch Hand
    Posts: 43
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Try using Struts Console. It will make life easier.
     
    Don't get me started about those stupid light bulbs.
      Bookmark Topic Watch Topic
    • New Topic