- This topic has 3 replies, 3 voices, and was last updated 20 years ago by BrianFox.
-
AuthorPosts
-
BrianFoxMemberI walked through all the steps to create a web project following along with the tutorial. When I get to deploy the application, Tomcat throws the following exception:
Nov 12, 2004 2:02:11 PM org.apache.commons.digester.Digester error
SEVERE: Parse Error at line 3 column 187: Attribute “xmlns” must be declared for element type “web-app”.
org.xml.sax.SAXParseException: Attribute “xmlns” must be declared for element type “web-app”.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown 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.addDTDDefaultAttrsAndValidate(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)There are compiler errors according to the editor in web.xml also. The web.xml file:
<?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/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>
Scott AndersonParticipantThe problem is that you specified that you wanted a J2EE 1.4 project and Tomcat only supports J2EE 1.3. The web.xml is perfectly valid for a container that supports it. To correct the issue, simply recreate a J2EE 1.3 web project and use that instead. For additional information on web projects, please see the Web Project quickstart in the Documentation section of the website.
Riyad KallaMemberJust a clarification, this won’t work with Tomcat 4, but should work fine with Tomcat 5 (supports Web 2.4 spec)
BrianFoxMemberThat solved it, thanks.
-
AuthorPosts