File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes DTD problem in Struts-config.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "DTD problem in Struts-config.xml" Watch "DTD problem in Struts-config.xml" New topic

DTD problem in Struts-config.xml

vishnu vardhana reddy vaka

Joined: May 03, 2006
Posts: 9
Dear all,

i deployed the web application with struts 1.2 DTD declaration in struts-config.xml , that some times giving exception input/output error while parsing the struts-config.xml and then its showing servlet inactive message when i try to access the application from browser .

some times its deploying fine.. for deploying successfully , i removed the DTD delcaration completely. now the applciation is deploying and running fine. but itz throwing some execptions at server console like <strus-config> no grammer found etc..

i do not understand this behaviour.can some one please suggest me how to go about this .

i am using tomcat 5.0.30

Thanks in advance.

Vishnu Vardahna Reddy.Vaka
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3381

Hello Vishnu,

Did you have the struts-1.2.x jar in the "lib" folder of either your web application (TOMCAT_HOME/webapps/YOURAPP/WEB-INF/lib) or the shared lib folder of Tomcat (TOMCAT_HOME/shared/lib)?

Just check that. It would be better if you could paste the error message what you get so as to help the people in giving a perfect solution.

Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
To elaborate on what Raghavan said, the important thing is that the jar files in your WEB-INF/lib directory match the DTD. If you have Struts 1.2.x jar files, you must have a Struts 1.2 DTD. If you have Struts 1.3.x jar files, you must have a Struts 1.3 DTD.

Consultant, Sima Solutions
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3381

Yes, why you need a .jar file? Since it contains the respectice DTD file.

Why you want the DTD file to be present? because its presence helps the container (JSP engine) to validate the xml tags compliant to that of struts-config DTD so as to ensure you are up to the expectation of Struts framework.

Does that help a little more?
I agree. Here's the link:
subject: DTD problem in Struts-config.xml
It's not a secret anymore!