Web Server 6.1 Startup Exception Failure ContextConfig /web-app-uri WEB3524 Parse Error in Application web.xml, org.xml.sax.SAXParseException The Content of Element Type "web-app" Must Match

(Doc ID 1287686.1)

Last updated on AUGUST 25, 2017

Applies to:

Oracle iPlanet Web Server - Version 6.1 to 7.0 [Release 6.1 to 7.0]
Information in this document applies to any platform.
***Checked for relevance on 21-11-2012***

Symptoms

After adding a <listener> element to amserver web application. Web server reports the following exceptions in the errors log on startup.

info (24959): CORE3282: stdout: org.xml.sax.SAXParseException: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".

 failure (24959): ContextConfig[/amserver] WEB3524: Parse error in application web.xml
org.xml.sax.SAXParseException: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".

failure (24959): ContextConfig[/amserver]: WEB3525: Occurred at line 753 column 11

failure (24959): ContextConfig[/amserver]: WEB3541: Marking this application unavailable due to previous error(s)

failure (24959): WebModule[/amserver]: WEB2705: Context startup failed due to previous errors

failure (24959): WebModule[/amserver]: WEB2720: Error initializing naming context for context /amserver
javax.naming.NamingException: WEB3880: Unknown context name : StandardEngine[null].StandardHost[https-login.xxxxx.com].StandardContext[/amserver]

Changes

This error is caused because the web.xml deployment descriptor file elements are out of order with the 2.3 servlet specification.

The <listener> element was placed in the applications web.xml file before "display-name, description, distributable,context-param*, filter*, filter-mapping*" elements.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' "http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
   <listener>
        <listener-class>com.vz.am.audit.contexListener.AuditListener</listener-class>
    </listener>

<display-name>Access Manager Services</display-name>
<distributable/>
        <context-param>

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms