title: Deploying Spring Boot war with Jersey in Wildfly
body: <p>I have a project where I use Spring boot to build a stand alone jar.  It uses jersey to serve up the back end, and I have it configured to also host an angular/js front end in the resources folder.  </p>
  
  <p>The solution I would like is that this can be standalone in the jar file, and run by itself. But also have a configuration where we build it as a war file, and run it alongside another war inside of Wildfly. </p>
  
  <p>I can get it to compile a war, but as soon as I try to start it up, it appears I get issues with Tomcat.  Has anyone tried running an environment like this?</p>
  
  <p>Here is the exception logs.</p>
  
  <pre><code>    11:14:22,316 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-9) MSC000001: Failed to start service jboss.deployment.unit."testApp-0.0.1-SNAPSHOT.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."testApp-0.0.1-SNAPSHOT.war".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment "testApp-0.0.1-SNAPSHOT.war"
      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [wildfly-server-8.2.1.Final-patch9.jar:8.2.1.Final-patch9]
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_101]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_101]
      at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_101]
  Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS017327: Deployment error processing SCI for jar: tomcat-embed-websocket-8.5.28.jar
      at org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.loadSci(ServletContainerInitializerDeploymentProcessor.java:207)
      at org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.deploy(ServletContainerInitializerDeploymentProcessor.java:128)
      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [wildfly-server-8.2.1.Final-patch9.jar:8.2.1.Final-patch9]
      ... 5 more
  Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS017327: Deployment error processing SCI for jar: tomcat-embed-websocket-8.5.28.jar
      at org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.loadSci(ServletContainerInitializerDeploymentProcessor.java:199)
      ... 7 more
  Caused by: java.lang.ClassNotFoundException: # Licensed to the Apache Software Foundation (ASF) under one or more from [Module "deployment.testApp-0.0.1-SNAPSHOT.war:main" from Service Module Loader]
      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final]
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]
      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final]
      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final]
      at org.wildfly.extension.undertow.deployment.ServletContainerInitializerDeploymentProcessor.loadSci(ServletContainerInitializerDeploymentProcessor.java:191)
      ... 7 more
  
  11:14:22,321 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 2) JBAS014613: Operation ("deploy") failed - address: ([("deployment" =&gt; "testApp-0.0.1-SNAPSHOT.war")]) - failure description: {"JBAS014671: Failed services" =&gt; {"jboss.deployment.unit.\"testApp-0.0.1-SNAPSHOT.war\".INSTALL" =&gt; "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"testApp-0.0.1-SNAPSHOT.war\".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment \"testApp-0.0.1-SNAPSHOT.war\"
      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS017327: Deployment error processing SCI for jar: tomcat-embed-websocket-8.5.28.jar
      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS017327: Deployment error processing SCI for jar: tomcat-embed-websocket-8.5.28.jar
      Caused by: java.lang.ClassNotFoundException: # Licensed to the Apache Software Foundation (ASF) under one or more from [Module \"deployment.testApp-0.0.1-SNAPSHOT.war:main\" from Service Module Loader]"}}
  11:14:22,323 ERROR [org.jboss.as.server] (management-handler-thread - 2) JBAS015870: Deploy of deployment "testApp-0.0.1-SNAPSHOT.war" was rolled back with the following failure message: 
  {"JBAS014671: Failed services" =&gt; {"jboss.deployment.unit.\"testApp-0.0.1-SNAPSHOT.war\".INSTALL" =&gt; "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"testApp-0.0.1-SNAPSHOT.war\".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment \"testApp-0.0.1-SNAPSHOT.war\"
      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS017327: Deployment error processing SCI for jar: tomcat-embed-websocket-8.5.28.jar
      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS017327: Deployment error processing SCI for jar: tomcat-embed-websocket-8.5.28.jar
      Caused by: java.lang.ClassNotFoundException: # Licensed to the Apache Software Foundation (ASF) under one or more from [Module \"deployment.testApp-0.0.1-SNAPSHOT.war:main\" from Service Module Loader]"}}
  11:14:22,344 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-7) HV000001: Hibernate Validator 5.1.3.Final
  11:14:25,469 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015877: Stopped deployment testApp-0.0.1-SNAPSHOT.war (runtime-name: testApp-0.0.1-SNAPSHOT.war) in 3146ms
  11:14:25,470 INFO  [org.jboss.as.controller] (management-handler-thread - 2) JBAS014774: Service status report
  JBAS014777:   Services which failed to start:      service jboss.deployment.unit."testApp-0.0.1-SNAPSHOT.war".INSTALL
  
  [2018-03-09 11:14:25,528] Artifact testApp:war: Error during artifact deployment. See server log for details.
  [2018-03-09 11:14:25,528] Artifact testApp:war: java.lang.Exception: {"JBAS014671: Failed services" =&gt; {"jboss.deployment.unit.\"testApp-0.0.1-SNAPSHOT.war\".INSTALL" =&gt; "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"testApp-0.0.1-SNAPSHOT.war\".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment \"testApp-0.0.1-SNAPSHOT.war\"
      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS017327: Deployment error processing SCI for jar: tomcat-embed-websocket-8.5.28.jar
      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS017327: Deployment error processing SCI for jar: tomcat-embed-websocket-8.5.28.jar
      Caused by: java.lang.ClassNotFoundException: # Licensed to the Apache Software Foundation (ASF) under one or more from [Module \"deployment.testApp-0.0.1-SNAPSHOT.war:main\" from Service Module Loader]"}}
  </code></pre>
  
  <p>Here is my current pom file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.dematic.wms&lt;/groupId&gt;
      &lt;artifactId&gt;app-workflow&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
  
      &lt;name&gt;app-workflow&lt;/name&gt;
      &lt;description&gt;Demo project for Spring Boot&lt;/description&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;1.2.7.RELEASE&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
  
          &lt;spring.version&gt;5.0.4.RELEASE&lt;/spring.version&gt;
          &lt;!--&lt;hsqldb.version&gt;2.4.0&lt;/hsqldb.version&gt;--&gt;
          &lt;dbh2.version&gt;1.4.195&lt;/dbh2.version&gt;
          &lt;!--&lt;derby.version&gt;10.11.1.1&lt;/derby.version&gt;--&gt;
  
          &lt;wildfly.version&gt;9.0.2.Final&lt;/wildfly.version&gt;
          &lt;cargo.container.id&gt;wildfly9x&lt;/cargo.container.id&gt;
          &lt;cargo.container.url&gt;http://download.jboss.org/wildfly/${wildfly.version}/wildfly-${wildfly.version}.zip
          &lt;/cargo.container.url&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;artifactId&gt;tomcat-embed-el&lt;/artifactId&gt;
                      &lt;groupId&gt;org.apache.tomcat.embed&lt;/groupId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;tomcat-embed-core&lt;/groupId&gt;
                      &lt;artifactId&gt;org.apache.tomcat.embed&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;tomcat-embed-websocket&lt;/groupId&gt;
                      &lt;artifactId&gt;org.apache.tomcat.embed&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
                      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.jersey.containers&lt;/groupId&gt;
              &lt;artifactId&gt;jersey-container-servlet&lt;/artifactId&gt;
              &lt;version&gt;2.26&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
              &lt;artifactId&gt;commons-lang3&lt;/artifactId&gt;
              &lt;version&gt;3.5&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-io&lt;/groupId&gt;
              &lt;artifactId&gt;commons-io&lt;/artifactId&gt;
              &lt;version&gt;2.6&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.ws.rs&lt;/groupId&gt;
              &lt;artifactId&gt;jsr311-api&lt;/artifactId&gt;
              &lt;version&gt;1.1.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-logging&lt;/artifactId&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
                      &lt;artifactId&gt;log4j-over-slf4j&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
                      &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.4&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;packagingExcludes&gt;WEB-INF/lib/tomcat-*.jar&lt;/packagingExcludes&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;jdk8&lt;/id&gt;
              &lt;activation&gt;
                  &lt;jdk&gt;1.8&lt;/jdk&gt;
              &lt;/activation&gt;
              &lt;build&gt;
                  &lt;plugins&gt;
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                          &lt;artifactId&gt;build-helper-maven-plugin&lt;/artifactId&gt;
                          &lt;executions&gt;
                              &lt;execution&gt;
                                  &lt;id&gt;reserve-network-port&lt;/id&gt;
                                  &lt;goals&gt;
                                      &lt;goal&gt;reserve-network-port&lt;/goal&gt;
                                  &lt;/goals&gt;
                                  &lt;phase&gt;process-resources&lt;/phase&gt;
                                  &lt;configuration&gt;
                                      &lt;portNames&gt;
                                          &lt;portName&gt;appserver.port&lt;/portName&gt;
                                          &lt;portName&gt;appserver.ajp.port&lt;/portName&gt;
                                          &lt;portName&gt;appserver.transaction.port&lt;/portName&gt;
                                      &lt;/portNames&gt;
                                  &lt;/configuration&gt;
                              &lt;/execution&gt;
                          &lt;/executions&gt;
                      &lt;/plugin&gt;
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.codehaus.cargo&lt;/groupId&gt;
                          &lt;artifactId&gt;cargo-maven2-plugin&lt;/artifactId&gt;
                          &lt;configuration&gt;
                              &lt;configuration&gt;
                                  &lt;properties&gt;
                                      &lt;cargo.servlet.port&gt;${appserver.port}&lt;/cargo.servlet.port&gt;
                                      &lt;cargo.jboss.ajp.port&gt;${appserver.ajp.port}&lt;/cargo.jboss.ajp.port&gt;
                                      &lt;cargo.jboss.transaction.statusManager.port&gt;
                                          ${appserver.transaction.port}
                                      &lt;/cargo.jboss.transaction.statusManager.port&gt;
                                      &lt;cargo.jboss.configuration&gt;standalone-full&lt;/cargo.jboss.configuration&gt;
                                  &lt;/properties&gt;
                              &lt;/configuration&gt;
                          &lt;/configuration&gt;
                      &lt;/plugin&gt;
                      &lt;plugin&gt;
                          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                          &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;
                          &lt;configuration&gt;
                              &lt;systemPropertyVariables&gt;
                                  &lt;port&gt;${appserver.port}&lt;/port&gt;
                              &lt;/systemPropertyVariables&gt;
                          &lt;/configuration&gt;
                      &lt;/plugin&gt;
                  &lt;/plugins&gt;
              &lt;/build&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
  &lt;/project&gt;
  </code></pre>