"web-app is not bound as a global element" when deploying a war in JBoss EAP?
Issue
Deploying a war with a web.xml starting with this throws the exception below:
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsichemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
Exception:
Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Element {http://java.sun.com/xml/ns/j2ee http://java.sun.com/j2ee/dtds/web-app_2_2.dtd}web-app is not bound as a global element.
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:203)
at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:168)
...
Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Element {http://java.sun.com/xml/ns/j2ee http://java.sun.com/j2ee/dtds/web-app_2_2.dtd}web-app is not bound as a global element.
at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:660)
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:401)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
...
DEPLOYMENTS IN ERROR:
Deployment "vfszip:/jboss-eap-5.1.0/jboss-eap-5.1/jboss-as/server/active/deploy/helloWorld.war/" is in error due to the following reason(s): org.jboss.xb.binding.JBossXBRuntimeException: Element {http://java.sun.com/xml/ns/j2ee http://java.sun.com/j2ee/dtds/web-app_2_2.dtd}web-app is not bound as a global element.
Environment
- JBoss Enterprise Application Platform (EAP) 5.1
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.