title: org.springframework.web.SpringServletContainerInitializer not found
body: <p>Iam migrating my java1.5 based application  to java1.6  and deploying it to was8.5 server instead of was6.1 server.</p>
  
  <p>When deployed to WAS8.5 it throws the following errors which could be as I have org.springframework.web.servlet.DispatcherServlet defined in my web.xml</p>
  
  <p>The context xml file has beans which is are in a  jar added to the web-inf/lib/*.jar</p>
  
  <pre><code>&lt;servlet-name&gt;MyServlet&lt;/servlet-name&gt;
   &lt;display-name&gt;MyServlet&lt;/display-name&gt;
   &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
   &lt;init-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/spring/my-context.xml&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  
  [10/10/13 14:13:59:862 IST] 00000079 AppManagement W   ADMA0116W: Unable to start: CASEAR using: WebSphere:name=ApplicationManager,process=server1,platform=proxy,node=b60jkyl-7010Node09,version=8.5.5.0,type=ApplicationManager,mbeanIdentifier=ApplicationManager,cell=b60jkyl-7010Node09Cell,spec=1.0 exception is: javax.management.MBeanException: Exception thrown in RequiredModelMBean while trying to invoke operation startApplication
  at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1191)
  at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:995)
  at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:848)
  at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:774)
  at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335)
  at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
  at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)
  at com.ibm.ws.management.application.AppManagementImpl._startApplication(AppManagementImpl.java:1482)
  at com.ibm.ws.management.application.AppManagementImpl.startApplication(AppManagementImpl.java:1371)
  at com.ibm.ws.management.application.AppManagementImpl.startApplication(AppManagementImpl.java:1320)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
  at java.lang.reflect.Method.invoke(Method.java:611)
  at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:49)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
  at java.lang.reflect.Method.invoke(Method.java:611)
  at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:256)
  at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1148)
  at java.security.AccessController.doPrivileged(AccessController.java:252)
  at com.ibm.oti.security.CheckedAccessControlContext.securityCheck(CheckedAccessControlContext.java:30)
  at sun.misc.JavaSecurityAccessWrapper.doIntersectionPrivilege(JavaSecurityAccessWrapper.java:41)
  at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1142)
  at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:995)
  at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:848)
  at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:774)
  at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335)
  at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
  at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)
  at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
  at java.lang.reflect.Method.invoke(Method.java:611)
  at com.ibm.ws.management.connector.soap.SOAPConnector.invoke(SOAPConnector.java:478)
  at com.ibm.ws.management.connector.soap.SOAPConnector.service(SOAPConnector.java:314)
  at com.ibm.ws.management.connector.soap.SOAPConnection.handleRequest(SOAPConnection.java:65)
  at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:733)
  at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:532)
  at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)
  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.springframework.web.SpringServletContainerInitializer not found
  at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:432)
  at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718)
  at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1175)
  at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370)
  at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)
  at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)
  at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:774)
  at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1374)
  at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2179)
  at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)
  at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
  at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388)
  at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116)
  at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:663)
  at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5384)
  at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5600)
  at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
  at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:677)
  at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:621)
  at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1266)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
  at java.lang.reflect.Method.invoke(Method.java:611)
  at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:49)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
  at java.lang.reflect.Method.invoke(Method.java:611)
  at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:256)
  at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1148)
  at java.security.AccessController.doPrivileged(AccessController.java:252)
  at com.ibm.oti.security.CheckedAccessControlContext.securityCheck(CheckedAccessControlContext.java:30)
  at sun.misc.JavaSecurityAccessWrapper.doIntersectionPrivilege(JavaSecurityAccessWrapper.java:41)
  at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1142)
  ... 41 more
  Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: javax.servlet.ServletContainerInitializer: Provider org.springframework.web.SpringServletContainerInitializer not found
  at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:759)
  at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
  at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426)
  ... 75 more
  Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: javax.servlet.ServletContainerInitializer: Provider org.springframework.web.SpringServletContainerInitializer not found
  at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:176)
  at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:746)
  ... 77 more
  Caused by: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider org.springframework.web.SpringServletContainerInitializer not found
  at java.util.ServiceLoader$ServiceIterator.next(ServiceLoader.java:208)
  at com.ibm.ws.webcontainer.webapp.WebAppImpl.initializeServletContainerInitializers(WebAppImpl.java:535)
  at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:409)
  at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
  at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
  ... 78 more
  </code></pre>
  
  <p>What I can see is org.springframework.web.SpringServletContainerInitializer  is not in my "spring-web-3.0.6.RELEASE.jar"  but it is in subsequent version 3.1 onwards.</p>
  
  <p>Even if I use spring web 3.1 version it then give null exception.</p>
  
  <p>It looks like deploying to WAS8.5 server with java version is 6.0 fails at ServletContainerInitializer (java6, since servlet3.0) . Hope if some one has come across this issue.</p>
  
  <p>Thanks</p>
  
  <p>=================
  Error trace when replacing spring web 3.0 to 3.1 so that it finds SpringServletContainerInitializer.java</p>
  
  <p>com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: null
      at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:432)
      at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1175)
      at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370)
      at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)
      at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:774)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2182)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)
      at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:994)
      at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:502)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)
  Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: null
      at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:759)
      at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
      at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426)
      ... 14 more
  Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: null
      at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:176)
      at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:749)
      ... 16 more
  Caused by: java.lang.NullPointerException
      at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:142)
      at com.ibm.ws.webcontainer.webapp.WebAppImpl.initializeServletContainerInitializers(WebAppImpl.java:613)
      at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:409)
      at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
      at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
      ... 17 more</p>