title: Java - Deployment Error - Unexpected content of type 'element start' named '{urn:jboss:module:1.1}module'
body: <p>I was trying to add <code>jsf2.2</code> into <code>JBoss 7.0 server</code> following <strong><a href="http://www.mastertheboss.com/javaee/jsf/installing-jsf-22-on-jboss-as-7" rel="nofollow noreferrer">this article's</a></strong> 2nd option. I created folder with name <code>2.2</code> within <code>/modules/javax/faces/api/</code> and <code>modules\com\sun\jsf-impl</code> and added <strong>jsf-api-2.2.14.jar</strong> and <strong>jsf-impl-2.2.14.jar</strong> respectively. </p>
  
  <p>The <code>module.xml</code> file within <code>/modules/javax/faces/api/2.2</code> looks like</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;module xmlns="urn:jboss:module:1.1" name="javax.faces.api" slot="2.2"&gt;
      &lt;dependencies&gt;
          &lt;module name="javax.el.api" export="true"/&gt;
          &lt;module name="javax.servlet.api" export="true"/&gt;
          &lt;module name="javax.servlet.jsp.api" export="true"/&gt;
          &lt;module name="javax.servlet.jstl.api" export="true"/&gt;
          &lt;module name="javax.validation.api" export="true"/&gt;
          &lt;module name="com.sun.jsf-impl" slot="2.2"/&gt;
      &lt;/dependencies&gt;
  
      &lt;resources&gt;
         &lt;resource-root path="jsf-api-2.2.14.jar"/&gt;
      &lt;/resources&gt;
  &lt;/module&gt;
  </code></pre>
  
  <p>and <code>module.xml</code> file within <code>/modules/com/sunjsf-impl/2.2</code> looks like</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;module xmlns="urn:jboss:module:1.1" name="com.sun.jsf-impl" slot="2.2"&gt;
      &lt;properties&gt;
          &lt;property name="jboss.api" value="private"/&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;module name="javax.faces.api" slot="2.2"/&gt;
          &lt;module name="javaee.api"/&gt;
          &lt;module name="javax.servlet.jstl.api"/&gt;
          &lt;module name="org.apache.xerces" services="import"/&gt;
          &lt;module name="org.apache.xalan" services="import"/&gt;
      &lt;/dependencies&gt;
  
      &lt;resources&gt;
          &lt;resource-root path="jsf-impl-2.2.14.jar"/&gt;
      &lt;/resources&gt;
  &lt;/module&gt;
  </code></pre>
  
  <p>and <code>jboss-deployment-structure.xml</code> looks like below in both <strong>Project</strong> and and <strong>JBoss Server</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;jboss-deployment-structure&gt;
  &lt;deployment&gt;
      &lt;exclusions&gt;
       &lt;module name="org.apache.log4j" /&gt;
       &lt;module name="javax.faces.api" /&gt;
       &lt;module name="com.sun.jsf-impl" /&gt;
      &lt;/exclusions&gt;
   &lt;dependencies&gt;
       &lt;module name="javax.faces.api" slot="2.2"/&gt;
       &lt;module name="com.sun.jsf-impl" slot="2.2"/&gt;
      &lt;/dependencies&gt;
  &lt;/deployment&gt;
  &lt;/jboss-deployment-structure&gt;
  </code></pre>
  
  <p>After all these set up done, when I run the project, I get below <strong>error</strong> in <strong>modules\javax\faces\api\2.2\module.xml</strong></p>
  
  <blockquote>
    <p><strong>Unexpected content of type 'element start' named
    '{urn:jboss:module:1.1}module'</strong></p>
  </blockquote>
  
  <p>But I don't know what's wrong with that line in file mentioned above. Everything seems valid there. Here is the complete <code>StackTrace</code></p>
  
  <pre><code>at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:67) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [:1.7.0_79]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.7.0_79]
      at java.lang.Thread.run(Unknown Source) [:1.7.0_79]
  Caused by: org.jboss.modules.ModuleLoadException: Error loading module from D:\Eclipse\jboss-as-web-7.0.2.Final\jboss-as-web-7.0.2.Final\modules\javax\faces\api\2.2\module.xml
      at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:249)
      at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:200)
      at org.jboss.modules.LocalModuleLoader.parseModuleInfoFile(LocalModuleLoader.java:147)
      at org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:124)
      at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:245)
      at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:194)
      at org.jboss.modules.LocalModuleLoader.preloadModule(LocalModuleLoader.java:97)
      at org.jboss.modules.ModuleLoader.preloadExportedModule(ModuleLoader.java:205)
      at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:218)
      at org.jboss.as.server.moduleservice.ServiceModuleLoader.preloadModule(ServiceModuleLoader.java:161) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:176)
      at org.jboss.modules.Module.linkImports(Module.java:1041)
      at org.jboss.modules.Module.relink(Module.java:1153)
      at org.jboss.modules.ModuleLoader.relink(ModuleLoader.java:400)
      at org.jboss.as.server.moduleservice.ServiceModuleLoader.relinkModule(ServiceModuleLoader.java:204) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
      at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:64) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
      ... 5 more
  Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[25,72]
  Message: Unexpected content of type 'element start' named '{urn:jboss:module:1.1}module'
      at org.jboss.modules.ModuleXmlParser.unexpectedContent(ModuleXmlParser.java:312)
      at org.jboss.modules.ModuleXmlParser.parseDocument(ModuleXmlParser.java:503)
      at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:244)
      ... 20 more
  </code></pre>
  
  <p>Could someone help me out through this?</p>