GeeCON Prague 2014*
The moose likes Struts and the fly likes Need the techinical help for running sample struts program using Myeclipse5.1.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Need the techinical help for running sample struts program using Myeclipse5.1.1" Watch "Need the techinical help for running sample struts program using Myeclipse5.1.1" New topic
Author

Need the techinical help for running sample struts program using Myeclipse5.1.1

Sridhar Ranganthan
Ranch Hand

Joined: Mar 12, 2009
Posts: 35
Hi ,

I have run the struts through the Myeclipse5.1.1v very basic login program.I have deployed in tomcat 4.1.
when i start the server through the eclipse or cmd prompt iam getting the following error,

org.xml.sax.SAXParseException: Document root element "web-app", must match DOCTYPE root "null".
SEVERE: Parse Error at line 2 column 221: Document is invalid: no grammar found.
.

can any one fix it? and help me.


Regards,
Sridhar.R
Andy Duplain
Greenhorn

Joined: Jun 20, 2007
Posts: 5
Could you show us the contents of the app's web.xml?

Cheers,
Andy
Sridhar Ranganthan
Ranch Hand

Joined: Mar 12, 2009
Posts: 35
Hi,

Please look in to this...

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>


Regards,
Sri


Andy Duplain
Greenhorn

Joined: Jun 20, 2007
Posts: 5
Try adding this before <web-app>:

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Need the techinical help for running sample struts program using Myeclipse5.1.1