This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error" Watch "Error" New topic
Author

Error

Saravanan Mrajan
Greenhorn

Joined: Jun 28, 2009
Posts: 18
hi,

i am using eclipse galileo and struts 1.3.10.

while testing it in tomcat, i am getting an error "org.xml.sax.SAXParseException: Document root element "struts-config", must match DOCTYPE root "null" ".

what could be the reason for this error?

Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Saravanan MahaRaj wrote:"org.xml.sax.SAXParseException: Document root element "struts-config", must match DOCTYPE root "null" ".

Google out the error.
And please look at you "strut-config.xml" file, it may defined using no DOCTYPE (dtd) declaration.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Saravanan Mrajan
Greenhorn

Joined: Jun 28, 2009
Posts: 18
Sagar Rohankar wrote:
Saravanan MahaRaj wrote:"org.xml.sax.SAXParseException: Document root element "struts-config", must match DOCTYPE root "null" ".

Google out the error.
And please look at you "strut-config.xml" file, it may defined using no DOCTYPE (dtd) declaration.



my struts-config.xml contains the doctype as below, so..?

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://struts.apache.org/dtds/struts-config_1_3.dtd">
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

DOCTYPLE looks OK.

Some suggestion,
please make sure libs and configuration are for Struts 1.3 and If you're using any IDE, eclipse, NB, as they come up with the xml validator, so validate this xml.
Saravanan Mrajan
Greenhorn

Joined: Jun 28, 2009
Posts: 18
Sagar Rohankar wrote:DOCTYPLE looks OK.

Some suggestion,
please make sure libs and configuration are for Struts 1.3 and If you're using any IDE, eclipse, NB, as they come up with the xml validator, so validate this xml.


Thanks!

i am using eclipse. i have placed all jar files of struts1.3 under 'lib' directory and .dtd files under 'WEB-INF' folder of my project.
but it's not working and again i am getting the same error.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Please Google this error and you can find this issue discussed before, go through the discussion and find out what you're missing.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Error
 
Similar Threads
Problem running a struts app using JBuilder8 and Tomcat 4.1
Deployment of Struts Application in Websphere 3.5.2
How to create XML file at runtime in Projects root folder - context root in Struts1.2 or 1.3 ?
webgroup not found exception in wsad
Getting Parse Error