title: Failed to determine servlet: java.lang.NullPointerException at org.jboss.as.web.deployment.JBossContextConfig.beforeLoadOnStartup
body: <p>I'm migrating a WebSphere application to JBoss EAP 6.4. During deployment, I get the below error:</p>
  
  <blockquote>
    <p>Failed to determine servlet: java.lang.NullPointerException</p>
  </blockquote>
  
  <p>With this stack trace:</p>
  
  <pre><code>12:48:06,194 DEBUG [org.jboss.as.security] (MSC service thread 1-2) Qualified url patterns: {/=PatternInfo[pattern=/,type=3,isOverridden=false,qualifiers=[]]}
  12:48:06,194 FINE  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 132) ConfigureListener.contextInitialized(/scWeb)
  12:48:06,224 DEBUG [org.jboss.as.web.security] (ServerService Thread Pool -- 96) Failed to determine servlet: java.lang.NullPointerException
      at org.jboss.as.web.deployment.JBossContextConfig.beforeLoadOnStartup(JBossContextConfig.java:666) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:178) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
      at org.jboss.as.web.deployment.JBossContextConfig.lifecycleEvent(JBossContextConfig.java:260) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3592) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3802) [jbossweb-7.5.7.Final-redhat-1.jar:7.5.7.Final-redhat-1]
      at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
      at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
      at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [rt.jar:1.8.0_45]
      at java.util.concurrent.FutureTask.run(Unknown Source) [rt.jar:1.8.0_45]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.8.0_45]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.8.0_45]
      at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_45]
      at org.jboss.threads.JBossThread.run(JBossThread.java:122)
  
  12:48:43,934 DEBUG [org.jboss.ejb.client.txn] (Periodic Recovery) Send recover request for transaction origin node identifier 1 to EJB receiver with node name inbaghpc00516
  12:52:40,593 ERROR [org.jboss.as.controller.management-operation] (HttpManagementService-threads - 1) JBAS013412: Timeout after [300] seconds waiting for service container stability. Operation will roll back. Step that first updated the service container was 'deploy' at address '[("deployment" =&gt; "PCB-5.3.ear")]'
  </code></pre>
  
  <p>How is this caused and how can I solve it?</p>
  
  <p>Here is my configurations for <code>scweb</code>....</p>
  
  <p>web.xml....</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app id="WebApp_1234567890" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt;
      &lt;display-name&gt;Shortcode Management Web&lt;/display-name&gt;
      &lt;distributable /&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/applicationContext-*.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;filter&gt;
          &lt;filter-name&gt;authenticationFilter&lt;/filter-name&gt;
          &lt;filter-class&gt;
              com.singtel.pcb.scweb.filter.AuthenticationFilter
          &lt;/filter-class&gt;
      &lt;/filter&gt;
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;authenticationFilter&lt;/filter-name&gt;
          &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
      &lt;listener&gt;
          &lt;listener-class&gt;
              org.springframework.web.context.ContextLoaderListener
          &lt;/listener-class&gt;
      &lt;/listener&gt; 
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;action&lt;/servlet-name&gt;
          &lt;servlet-class&gt;
              org.apache.struts.action.ActionServlet
          &lt;/servlet-class&gt;        
          &lt;init-param&gt;
              &lt;param-name&gt;config&lt;/param-name&gt;
              &lt;param-value&gt;
                  /WEB-INF/struts-config.xml
              &lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;debug&lt;/param-name&gt;
              &lt;param-value&gt;2&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;detail&lt;/param-name&gt;
              &lt;param-value&gt;2&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;load-on-startup&gt;2&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
          &lt;!-- Struts Action Servlet Mapping --&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;action&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
  &lt;!--    
      &lt;resource-ref id="ResourceRef_12345678909"&gt;
          &lt;res-ref-name&gt;jdbc/pcbDB&lt;/res-ref-name&gt;
          &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
          &lt;res-auth&gt;Container&lt;/res-auth&gt;
          &lt;res-sharing-scope&gt;Shareable&lt;/res-sharing-scope&gt;
      &lt;/resource-ref&gt;
   --&gt;    
      &lt;error-page&gt;
          &lt;error-code&gt;404&lt;/error-code&gt;
          &lt;location&gt;/404.html&lt;/location&gt;
      &lt;/error-page&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>struts-config.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd"&gt;
  
  &lt;struts-config&gt;
  
      &lt;!-- Form Beans --&gt;
  
      &lt;form-beans&gt;
          &lt;form-bean name="LoginForm"  type="com.singtel.pcb.scweb.forms.LoginActionFormBean" /&gt;
          &lt;!--many like this--&gt;
          &lt;/form-beans&gt;
  
      &lt;global-forwards&gt;
          &lt;!-- Default forward to "Welcome" action --&gt;
          &lt;!-- Demonstrates using index.jsp to forward --&gt;
          &lt;forward name="failure" path="/Error.jsp" /&gt;
          &lt;forward name="response" path="/Response.jsp" /&gt;
          &lt;forward name="Error" path="/Error.jsp" /&gt;
      &lt;/global-forwards&gt;    
  
      &lt;action-mappings&gt;
          &lt;action 
              name="LoginForm"
              attribute="LoginForm"
              type="com.singtel.pcb.scweb.action.LoginAction"
              path="/pages/login" 
              input="/pages/login.jsp"
              scope="request" 
              validate="true"&gt;
                  &lt;forward name="ShortcodeHome" path="/pages/lumlum.jsp" /&gt;
                  &lt;forward name="NumberLevelHome" path="/pages/sumnum.jsp" /&gt;
                  &lt;forward name="Failure" path="/pages/login.jsp" /&gt;
          &lt;/action&gt;
          &lt;!--many like this--&gt;
      &lt;/action-mappings&gt;
  
      &lt;controller locale="false" maxFileSize="500K" nocache="true" processorClass="org.springframework.web.struts.DelegatingRequestProcessor" /&gt;                  
  
      &lt;message-resources parameter="com.singtel.pcb.scweb.resource.ApplicationResources"/&gt;
  
      &lt;plug-in
          className="org.springframework.web.struts.ContextLoaderPlugIn"&gt;
          &lt;set-property property="contextConfigLocation"
              value="/WEB-INF/actions-*.xml" /&gt;
      &lt;/plug-in&gt;
  
      &lt;plug-in className="org.apache.struts.validator.ValidatorPlugIn"&gt;
          &lt;set-property property="pathnames"
              value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" /&gt;
      &lt;/plug-in&gt;
  
  &lt;/struts-config&gt;
  </code></pre>
  
  <p>applicationContext-config.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
      "http://www.springframework.org/dtd/spring-beans-2.0.dtd"&gt;
  &lt;beans&gt;
  
      &lt;bean id="userRoleService" class="com.singtel.pcb.sam.dto.UserRoleService"&gt;
          &lt;property name="dataSource" ref="dataSource"&gt;&lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="propertyConfigurer"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
          &lt;property name="locations"&gt;
              &lt;list&gt;
                  &lt;value&gt;
                      classpath:com/singtel/pcb/scweb/resource/scweb.properties
                  &lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="dataSource" 
          class="org.springframework.jndi.JndiObjectFactoryBean"&gt;
          &lt;property name="jndiName"&gt;
          &lt;value&gt;${database.connection.datasource}&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>