title: WAS8, Jersey2 Issue JerseyServletContainerInitializer not a subtype
body: <p>I am trying to deploy Jersey 2 application in Websphere 8. My pom has following dependency for jersey:</p>
  
  <pre><code>    &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.21&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>And web.xml has following entry:</p>
  
  <pre><code>    &lt;servlet&gt;
          &lt;servlet-name&gt;JerseyApp&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.glassfish.jersey.servlet.ServletContainer&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;jersey.config.server.provider.packages&lt;/param-name&gt;
          &lt;param-value&gt;com.tieto.vam.rest&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;JerseyApp&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>In Websphere application server, I have set following property:</p>
  
  <pre><code>com.ibm.websphere.jaxrs.server.DisableIBMJAXRSEngine=true
  </code></pre>
  
  <p>And I am trying to load JAX-RS jars from inside the war, by setting Module class loader to: Classes loaded with local class loader first (parent last)
  When I try to deploy this application (war) in Websphere, I get following error in startup:</p>
  
  <pre><code>com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: javax.servlet.ServletContainerInitializer: Provider org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer not a subtype
  at com.ibm.wsspi.runtime.component.WsComponentImpl.join(WsComponentImpl.java:432)
  at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCUList(CompositionUnitMgrImpl.java:1295)
  at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:275)
  at com.ibm.ws.runtime.component.ContainerHelper.startComponents(ContainerHelper.java:540)
  at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:627)
  at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:618)
  at com.ibm.ws.runtime.component.ApplicationServerImpl.start(ApplicationServerImpl.java:252)
  at com.ibm.ws.runtime.component.ContainerHelper.startComponents(ContainerHelper.java:540)
  at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:627)
  at com.ibm.ws.runtime.component.ContainerImpl.start(ContainerImpl.java:618)
  at com.ibm.ws.runtime.component.ServerImpl.start(ServerImpl.java:540)
  at com.ibm.ws.runtime.WsServerImpl.bootServerContainer(WsServerImpl.java:316)
  at com.ibm.ws.runtime.WsServerImpl.start(WsServerImpl.java:229)
  at com.ibm.ws.runtime.WsServerImpl.main(WsServerImpl.java:702)
  at com.ibm.ws.runtime.WsServer.main(WsServer.java:59)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
  at java.lang.reflect.Method.invoke(Method.java:508)
  at com.ibm.wsspi.bootstrap.WSLauncher.launchMain(WSLauncher.java:234)
  at com.ibm.wsspi.bootstrap.WSLauncher.main(WSLauncher.java:96)
  at com.ibm.wsspi.bootstrap.WSLauncher.run(WSLauncher.java:77)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
  at java.lang.reflect.Method.invoke(Method.java:508)
  at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
  at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
  at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
  at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
  at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
  at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
  at java.lang.reflect.Method.invoke(Method.java:508)
  at org.eclipse.core.launcher.Main.invokeFramework(Main.java:340)
  at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
  at org.eclipse.core.launcher.Main.run(Main.java:981)
  at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLauncher.java:406)
  at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:169)
  Caused by: com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: javax.servlet.ServletContainerInitializer: Provider org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer not a subtype
      at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:433)
      at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:719)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1201)
      at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1390)
      at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)
      at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:979)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:785)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl$5.run(ApplicationMgrImpl.java:2220)
      at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5396)
      at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5612)
      at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2225)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:436)
      at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:379)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:127)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:985)
      at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:524)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
  Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: javax.servlet.ServletContainerInitializer: Provider org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer not a subtype
      at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:914)
      at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:789)
      at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:427)
      ... 18 more
  Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: javax.servlet.ServletContainerInitializer: Provider org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer not a subtype
      at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:186)
      at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:904)
      ... 20 more
  Caused by: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer not a subtype
      at java.util.ServiceLoader.fail(ServiceLoader.java:250)
      at java.util.ServiceLoader.access$300(ServiceLoader.java:196)
      at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:387)
      at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:415)
      at java.util.ServiceLoader$1.next(ServiceLoader.java:491)
      at com.ibm.ws.webcontainer.webapp.WebAppImpl.initializeServletContainerInitializers(WebAppImpl.java:537)
      at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:410)
      at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
      at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:171)
      ... 21 more
  </code></pre>