Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts-config.xml file errors

 
shailesh kumar
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]
 
Merrill Higginson
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.
     
    Ajay Reddy
    Ranch Hand
    Posts: 43
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Try using Struts Console. It will make life easier.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic