javax.xml.stream.XMLStreamException: ParseError at [row,col]:[11,3] in jboss-web.xml
<p>I am using Java 1.6 and JBoss EAP 6.1.</p>

<p>My application runs on JBoss 5.1, but when I try to run my application on JBoss 6.1, I get this error:</p>

<pre><code>javax.xml.stream.XMLStreamException: ParseError at [row,col]:[11,3] in jboss-web.xml
</code></pre>

<p>JBoss's log:</p>

<pre><code>00:06:52,823 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "MyApplication-0.0.1-SNAPSHOT.war" (runtime-name: "MyApplication-0.0.1-SNAPSHOT.war")
00:06:54,743 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."MyApplication-0.0.1-SNAPSHOT.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."MyApplication-0.0.1-SNAPSHOT.war".PARSE: JBAS018733: Failed to process phase PARSE of deployment "MyApplication-0.0.1-SNAPSHOT.war"

Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018014: Failed to parse XML descriptor "/content/MyApplication-0.0.1-SNAPSHOT.war/WEB-INF/jboss-web.xml" at [11,3]
        at org.jboss.as.web.deployment.JBossWebParsingDeploymentProcessor.deploy(JBossWebParsingDeploymentProcessor.java:79)
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
        ... 5 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[11,3]
Message: Unexpected element 'class-loading' encountered
        at org.jboss.metadata.parser.util.MetaDataElementParser.unexpectedElement(MetaDataElementParser.java:109)
        at org.jboss.metadata.parser.jbossweb.JBossWebMetaDataParser.parse(JBossWebMetaDataParser.java:206)
        at org.jboss.as.web.deployment.JBossWebParsingDeploymentProcessor.deploy(JBossWebParsingDeploymentProcessor.java:71)
        ... 6 more

00:06:54,748 ERROR [org.jboss.as.server] (HttpManagementService-threads - 8) JBAS015870: Deploy of deployment "MyApplication-0.0.1-SNAPSHOT.war" was rolled back with the following failure message: 
{"JBAS014671: Failed services" =&gt; {"jboss.deployment.unit.\"MyApplication-0.0.1-SNAPSHOT.war\".PARSE" =&gt; "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"MyApplication-0.0.1-SNAPSHOT.war\".PARSE: JBAS018733: Failed to process phase PARSE of deployment \"MyApplication-0.0.1-SNAPSHOT.war\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018014: Failed to parse XML descriptor \"/content/MyApplication-0.0.1-SNAPSHOT.war/WEB-INF/jboss-web.xml\" at [11,3]
    Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[11,3]
Message: Unexpected element 'class-loading' encountered"}}
00:06:54,867 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment MyApplication-0.0.1-SNAPSHOT.war (runtime-name: MyApplication-0.0.1-SNAPSHOT.war) in 118ms
</code></pre>

<p>I'm getting this exception in <code>jboss-web.xml</code>:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;jboss-web&gt;

    &lt;!--   &lt;context-root&gt;MyApplication&lt;/context-root&gt;
    &lt;class-loading java2ClassLoadingCompliance="false"&gt;
        &lt;loader-repository&gt;com.globalss:loader=MyApplication.war
            &lt;loader-repository-config&gt;java2ParentDelegation=false&lt;/loader-repository-config&gt;
        &lt;/loader-repository&gt; 
    &lt;/class-loading&gt;--&gt;

    &lt;class-loading java2ClassLoadingCompliance="false"&gt;
        &lt;loader-repository&gt;
            org.myapp:loader=MyApplication.war
            &lt;loader-repository-config&gt;java2ParentDelegation=false
            &lt;/loader-repository-config&gt;
       &lt;/loader-repository&gt;
    &lt;/class-loading&gt;
    &lt;resource-ref&gt;
        &lt;res-ref-name&gt;database&lt;/res-ref-name&gt;
        &lt;jndi-name&gt;java:/database&lt;/jndi-name&gt;
    &lt;/resource-ref&gt;
    &lt;resource-ref&gt;
        &lt;res-ref-name&gt;dataSource&lt;/res-ref-name&gt;
        &lt;jndi-name&gt;java:/dataSource&lt;/jndi-name&gt;
    &lt;/resource-ref&gt;
&lt;/jboss-web&gt;
</code></pre>

<p>Why do we get this error?</p>

<p>What is the root cause of getting this error?</p>

<p>How do we solve this error?</p>