This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes struts-config.xml file errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts-config.xml file errors" Watch "struts-config.xml file errors" New topic
Author

struts-config.xml file errors

shailesh kumar
Ranch Hand

Joined: Jul 18, 2005
Posts: 36
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

Joined: Feb 15, 2005
Posts: 4864
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.


    Merrill
    Consultant, Sima Solutions
    shailesh kumar
    Ranch Hand

    Joined: Jul 18, 2005
    Posts: 36
    Thanks Merrill !!
    shailesh kumar
    Ranch Hand

    Joined: Jul 18, 2005
    Posts: 36
    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

    Joined: Apr 08, 2005
    Posts: 43
    Try using Struts Console. It will make life easier.
     
    GeeCON Prague 2014
     
    subject: struts-config.xml file errors