facebook

J2EE 1.4 and Tomcat question [Closed]

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #219429 Reply

    BrianFox
    Member

    I 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&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; version=”2.4″ xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”&gt;
    <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>

    #219432 Reply

    Scott Anderson
    Participant

    The 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.

    #219497 Reply

    Riyad Kalla
    Member

    Just a clarification, this won’t work with Tomcat 4, but should work fine with Tomcat 5 (supports Web 2.4 spec)

    #219516 Reply

    BrianFox
    Member

    That solved it, thanks.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: J2EE 1.4 and Tomcat question [Closed]

You must be logged in to post in the forum log in