title: Deployments Share JAR Files in WildFly 10
body: <p>I have a fully functioning web application packaged in a WAR format which I am trying to remove the *.jar files from /WEB-INF/lib and place into WildFly 10.</p>
  
  <p>What I have done so far (unsuccessfully) and the resources I have referenced are below.</p>
  
  <ol>
  <li>Copy *.jar from /WEB-INF/lib to C:...\wildfly-10.0.0.Final\standalone\deployments</li>
  <li>Deployed the copied JAR files successfully.</li>
  <li>Created a /WEB-INF/jboss-deployment-structure.xml (found below) to reference the jars in the deployments directory</li>
  </ol>
  
  <p>The above attempt was in response to <a href="https://stackoverflow.com/questions/26127554/share-util-jar-file-with-war-deployments-in-wildfly">Share util jar file with war deployments in Wildfly</a></p>
  
  <p>I am also open to attempting to try other methods.  I would think it would be possible to jar all the jars in my WEB-INF/lib into one jar and have WildFly 10 create an id for the jar.  Then my war file would specify this id somewhere.  The issue is I'm not quite sure how to google what I have just said with specific Wildfly/J2EE terminology.  Referencing <a href="https://docs.jboss.org/author/display/WFLY8/Class+Loading+in+WildFly" rel="nofollow noreferrer">https://docs.jboss.org/author/display/WFLY8/Class+Loading+in+WildFly</a> doesn't really give me specific examples to help me.</p>
  
  <p>jboss-deployment-structure.xml</p>
  
  <pre><code>&lt;jboss-deployment-structure&gt;
    &lt;!-- Make sub deployments isolated by default, so they cannot see each others classes without a Class-Path entry --&gt;
    &lt;ear-subdeployments-isolated&gt;false&lt;/ear-subdeployments-isolated&gt;
    &lt;!-- This corresponds to the top level deployment. For a war this is the war's module, for an ear --&gt;
    &lt;!-- This is the top level ear module, which contains all the classes in the EAR's lib folder     --&gt;
    &lt;deployment&gt;
       &lt;!-- exclude-subsystem prevents a subsystems deployment unit processors running on a deployment --&gt;
       &lt;!-- which gives basically the same effect as removing the subsystem, but it only affects single deployment --&gt;
      &lt;!-- This allows you to define additional dependencies, it is the same as using the Dependencies: manifest attribute --&gt;
      &lt;dependencies&gt;
          &lt;module name="deployment.aesh-0.33.11.jar" /&gt;
          &lt;module name="deployment.aether-api-1.13.1.jar" /&gt;
          &lt;module name="deployment.aether-impl-1.13.1.jar" /&gt;
          &lt;module name="deployment.aether-spi-1.13.1.jar" /&gt;
          &lt;module name="deployment.aether-util-1.13.1.jar" /&gt;
          &lt;module name="deployment.angular2-2.0.0-beta.7.jar" /&gt;
          &lt;module name="deployment.antlr-2.7.7.jar" /&gt;
          &lt;module name="deployment.antlr4-runtime-4.5.2-1.jar" /&gt;
          &lt;module name="deployment.aopalliance-1.0.jar" /&gt;
          &lt;module name="deployment.bcpkix-jdk15on-1.48.jar" /&gt;
          &lt;module name="deployment.bcprov-jdk15on-1.48.jar" /&gt;
          &lt;module name="deployment.bootstrap-3.3.6.jar" /&gt;
          &lt;module name="deployment.cglib-nodep-2.1_3.jar" /&gt;
          &lt;module name="deployment.checkstyle-6.16.1.jar" /&gt;
          &lt;module name="deployment.commons-beanutils-1.9.2.jar" /&gt;
          &lt;module name="deployment.commons-cli-1.3.1.jar" /&gt;
          &lt;module name="deployment.commons-codec-1.10.jar" /&gt;
          &lt;module name="deployment.commons-collections-3.2.1.jar" /&gt;
          &lt;module name="deployment.commons-compress-1.5.jar" /&gt;
          &lt;module name="deployment.commons-exec-1.3.jar" /&gt;
          &lt;module name="deployment.commons-io-2.4.jar" /&gt;
          &lt;module name="deployment.commons-lang3-3.4.jar" /&gt;
          &lt;module name="deployment.commons-logging-1.2.jar" /&gt;
          &lt;module name="deployment.dom4j-1.6.1.jar" /&gt;
          &lt;module name="deployment.gson-2.3.1.jar" /&gt;
          &lt;module name="deployment.guava-19.0.jar" /&gt;
          &lt;module name="deployment.hibernate-commons-annotations-4.0.5.Final.jar" /&gt;
          &lt;module name="deployment.hibernate-core-4.3.11.Final.jar" /&gt;
          &lt;module name="deployment.hibernate-jpa-2.1-api-1.0.0.Final.jar" /&gt;
          &lt;module name="deployment.httpclient-4.3.5.jar" /&gt;
          &lt;module name="deployment.httpcore-4.3.2.jar" /&gt;
          &lt;module name="deployment.jackson-core-asl-1.9.13.jar" /&gt;
          &lt;module name="deployment.jackson-mapper-asl-1.9.13.jar" /&gt;
          &lt;module name="deployment.jandex-1.1.0.Final.jar" /&gt;
          &lt;module name="deployment.jansi-1.9.jar" /&gt;
          &lt;module name="deployment.javassist-3.12.1.GA.jar" /&gt;
          &lt;module name="deployment.javassist-3.18.1-GA.jar" /&gt;
          &lt;module name="deployment.javax.servlet.jsp-api-2.3.1.jar" /&gt;
          &lt;module name="deployment.javax.servlet-api-3.1.0.jar" /&gt;
          &lt;module name="deployment.jboss-dmr-1.2.0.Final.jar" /&gt;
          &lt;module name="deployment.jboss-logging-3.1.3.GA.jar" /&gt;
          &lt;module name="deployment.jboss-logging-annotations-1.2.0.Beta1.jar" /&gt;
          &lt;module name="deployment.jboss-marshalling-1.4.2.Final.jar" /&gt;
          &lt;module name="deployment.jboss-marshalling-river-1.4.2.Final.jar" /&gt;
          &lt;module name="deployment.jboss-remoting-4.0.3.Final.jar" /&gt;
          &lt;module name="deployment.jboss-sasl-1.0.4.Final.jar" /&gt;
          &lt;module name="deployment.jboss-threads-2.1.1.Final.jar" /&gt;
          &lt;module name="deployment.jboss-transaction-api_1.2_spec-1.0.0.Final.jar" /&gt;
          &lt;module name="deployment.jboss-vfs-3.2.5.Final.jar" /&gt;
          &lt;module name="deployment.jcip-annotations-1.0.jar" /&gt;
          &lt;module name="deployment.jcommander-1.48.jar" /&gt;
          &lt;module name="deployment.jetty-rc-repacked-5.jar" /&gt;
          &lt;module name="deployment.jetty-repacked-9.2.13.v20150730.jar" /&gt;
          &lt;module name="deployment.jna-4.1.0.jar" /&gt;
          &lt;module name="deployment.jna-platform-4.1.0.jar" /&gt;
          &lt;module name="deployment.jquery-1.11.1.jar" /&gt;
          &lt;module name="deployment.jstl-1.2.jar" /&gt;
          &lt;module name="deployment.log4j-api-2.0.jar" /&gt;
          &lt;module name="deployment.log4j-core-2.0.jar" /&gt;
          &lt;module name="deployment.log4j-slf4j-impl-2.5.jar" /&gt;
          &lt;module name="deployment.maven-aether-provider-3.0.5.jar" /&gt;
          &lt;module name="deployment.maven-artifact-3.0.5.jar" /&gt;
          &lt;module name="deployment.maven-core-3.0.5.jar" /&gt;
          &lt;module name="deployment.maven-model-3.0.5.jar" /&gt;
          &lt;module name="deployment.maven-model-builder-3.0.5.jar" /&gt;
          &lt;module name="deployment.maven-plugin-annotations-3.2.jar" /&gt;
          &lt;module name="deployment.maven-plugin-api-3.0.5.jar" /&gt;
          &lt;module name="deployment.maven-repository-metadata-3.0.5.jar" /&gt;
          &lt;module name="deployment.maven-settings-3.0.5.jar" /&gt;
          &lt;module name="deployment.maven-settings-builder-3.0.5.jar" /&gt;
          &lt;module name="deployment.mx4j-tools-3.0.1.jar" /&gt;
          &lt;module name="deployment.mysql-connector-java-5.1.38.jar" /&gt;
          &lt;module name="deployment.netty-3.5.7.Final.jar" /&gt;
          &lt;module name="deployment.plexus-cipher-1.4.jar" /&gt;
          &lt;module name="deployment.plexus-classworlds-2.4.jar" /&gt;
          &lt;module name="deployment.plexus-component-annotations-1.5.5.jar" /&gt;
          &lt;module name="deployment.plexus-interpolation-1.14.jar" /&gt;
          &lt;module name="deployment.plexus-sec-dispatcher-1.3.jar" /&gt;
          &lt;module name="deployment.plexus-utils-3.0.10.jar" /&gt;
          &lt;module name="deployment.remoting-jmx-2.0.0.Final.jar" /&gt;
          &lt;module name="deployment.selenium-api-2.53.0.jar" /&gt;
          &lt;module name="deployment.selenium-chrome-driver-2.53.0.jar" /&gt;
          &lt;module name="deployment.selenium-edge-driver-2.53.0.jar" /&gt;
          &lt;module name="deployment.selenium-firefox-driver-2.53.0.jar" /&gt;
          &lt;module name="deployment.selenium-ie-driver-2.53.0.jar" /&gt;
          &lt;module name="deployment.selenium-java-2.53.0.jar" /&gt;
          &lt;module name="deployment.selenium-leg-rc-2.53.0.jar" /&gt;
          &lt;module name="deployment.selenium-remote-driver-2.53.0.jar" /&gt;
          &lt;module name="deployment.selenium-safari-driver-2.53.0.jar" /&gt;
          &lt;module name="deployment.selenium-server-2.53.0.jar" /&gt;
          &lt;module name="deployment.selenium-support-2.53.0.jar" /&gt;
          &lt;module name="deployment.sisu-guava-0.9.9.jar" /&gt;
          &lt;module name="deployment.sisu-guice-3.1.0-no_aop.jar" /&gt;
          &lt;module name="deployment.sisu-inject-bean-2.3.0.jar" /&gt;
          &lt;module name="deployment.sisu-inject-plexus-2.3.0.jar" /&gt;
          &lt;module name="deployment.slf4j-api-1.7.18.jar" /&gt;
          &lt;module name="deployment.snakeyaml-1.8.jar" /&gt;
          &lt;module name="deployment.spring-aop-4.1.6.RELEASE.jar" /&gt;
          &lt;module name="deployment.spring-beans-4.1.6.RELEASE.jar" /&gt;
          &lt;module name="deployment.spring-context-4.1.6.RELEASE.jar" /&gt;
          &lt;module name="deployment.spring-core-4.1.6.RELEASE.jar" /&gt;
          &lt;module name="deployment.spring-expression-4.1.6.RELEASE.jar" /&gt;
          &lt;module name="deployment.spring-jdbc-4.2.4.RELEASE.jar" /&gt;
          &lt;module name="deployment.spring-security-acl-4.0.3.RELEASE.jar" /&gt;
          &lt;module name="deployment.spring-security-config-4.0.1.RELEASE.jar" /&gt;
          &lt;module name="deployment.spring-security-core-4.0.1.RELEASE.jar" /&gt;
          &lt;module name="deployment.spring-security-taglibs-4.0.3.RELEASE.jar" /&gt;
          &lt;module name="deployment.spring-security-web-4.0.1.RELEASE.jar" /&gt;
          &lt;module name="deployment.spring-tx-4.2.4.RELEASE.jar" /&gt;
          &lt;module name="deployment.spring-web-4.1.6.RELEASE.jar" /&gt;
          &lt;module name="deployment.spring-webmvc-4.1.6.RELEASE.jar" /&gt;
          &lt;module name="deployment.stacks-client-1.0.2.Final.jar" /&gt;
          &lt;module name="deployment.staxmapper-1.1.0.Final.jar" /&gt;
          &lt;module name="deployment.wildfly-build-config-8.1.0.Final.jar" /&gt;
          &lt;module name="deployment.wildfly-cli-8.1.0.Final.jar" /&gt;
          &lt;module name="deployment.wildfly-controller-client-8.1.0.Final.jar" /&gt;
          &lt;module name="deployment.wildfly-maven-plugin-1.0.2.Final.jar" /&gt;
          &lt;module name="deployment.wildfly-protocol-8.1.0.Final.jar" /&gt;
          &lt;module name="deployment.wildfly-security-manager-1.0.0.Final.jar" /&gt;
          &lt;module name="deployment.xml-apis-1.0.b2.jar" /&gt;
          &lt;module name="deployment.xnio-api-3.2.2.Final.jar" /&gt;
          &lt;module name="deployment.xnio-nio-3.2.2.Final.jar" /&gt;
          &lt;module name="deployment.xz-1.2.jar" /&gt;
      &lt;/dependencies&gt;
      &lt;!-- These add additional classes to the module. In this case it is the same as including the jar in the EAR's lib directory --&gt;
      &lt;resources&gt;
        &lt;resource-root path="md.jar" /&gt;
      &lt;/resources&gt;
    &lt;/deployment&gt;
  &lt;/jboss-deployment-structure&gt;
  </code></pre>
  
  <p>The error log from WildFly indicating it cannot deploy my ROOT.war</p>
  
  <pre><code>13:27:30,977 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "antlr4-runtime-4.5.2-1.jar" (runtime-name : "antlr4-runtime-4.5.2-1.jar")
  13:27:30,978 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "antlr-2.7.7.jar" (runtime-name : "antlr-2.7.7.jar")
  13:27:30,978 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "angular2-2.0.0-beta.7.jar" (runtime-name : "angular2-2.0.0-beta.7.jar")
  13:27:30,979 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "aether-util-1.13.1.jar" (runtime-name : "aether-util-1.13.1.jar")
  13:27:30,979 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "aether-spi-1.13.1.jar" (runtime-name : "aether-spi-1.13.1.jar")
  13:27:30,979 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "aether-impl-1.13.1.jar" (runtime-name : "aether-impl-1.13.1.jar")
  13:27:30,979 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "aether-api-1.13.1.jar" (runtime-name : "aether-api-1.13.1.jar")
  13:27:30,981 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "aesh-0.33.11.jar" (runtime-name : "aesh-0.33.11.jar")
  13:27:30,983 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
  WFLYCTL0184:    New missing/unsatisfied dependencies:
        service jboss.deployment.unit."ROOT.war".beanmanager (missing) dependents: [service jboss.deployment.unit."ROOT.war".weld.weldClassIntrospector, service jboss.deployment.unit."ROOT.war".batch.environment] 
  WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."ROOT.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."ROOT.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "ROOT.war"
  
  13:27:31,234 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
  13:27:31,234 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
  13:27:31,234 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) started (with errors) in 47550ms - Started 4867 of 5891 services (3 services failed or missing dependencies, 1357 services are lazy, passive or on-demand)
  13:27:44,221 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0028: Stopped deployment ROOT.war (runtime-name: ROOT.war) in 11969ms
  13:27:44,285 INFO  [org.jboss.as.repository] (DeploymentScanner-threads - 2) WFLYDR0002: Content removed from location C:\home\toazi\apps\wildfly-10.0.0.Final\standalone\data\content\71\0188d928a988dddca670dade8e87ac9ec64b57\content
  13:27:44,285 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0009: Undeployed "ROOT.war" (runtime-name: "ROOT.war")
  13:27:44,286 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) WFLYCTL0183: Service status report
  WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."ROOT.war".INSTALL
  </code></pre>