NullPointerException thrown during webmodule startup
 Technote (troubleshooting)
 
Problem(Abstract)
During startup, of one of the web modules in an enterprise application fails with following exception in SystemOut.log file:

[5/10/06 9:02:25:087 EDT] 0000007f MBeanHelper 2 MBeanHelper printEx
THROW com.ibm.ws.exception.RuntimeError: java.lang.NullPointerException
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start
(DeployedApplicationImpl.java:766)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication
(ApplicationMgrImpl.java:683) Caused by: java.lang.NullPointerException
at com.ibm.ws.webcontainer.webapp.WebAppConfigurationHelper.
constructServletMappings
(WebAppConfigurationHelper.java:392)
at com.ibm.ws.webcontainer.webapp.WebAppConfigurationHelper.createConfiguration
(WebAppConfigurationHelper.java:137)
at com.ibm.ws.webcontainer.metadata.WebMetaDataFactory.createMetaData
(WebMetaDataFactory.java:157)
 
Cause
Duplicate entries in web.xml file.
 
Resolving the problem
After examining the web.xml file it is figured out that web.xml file had duplicate entries for the <servlet-mapping> xml tag:
<servlet-mapping>
<servlet-name>actionServlet</servlet-name>
<url-pattern>/action</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>actionController</servlet-name>
<url-pattern>/action</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>WSGuidelineAttachmentGet</servlet-name>
<url-pattern>/WSGuidelineAttachmentGet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>WSGuidelineAttachmentSet</servlet-name>
<url-pattern>/WSGuidelineAttachmentSet</url-pattern>
</servlet-mapping>

Follow these steps to resolve this issue:
  1. Uninstall the enterprise application from the WebSphere application server.
  2. Edit the application using ASTK or using WSAD/RAD, and update this web.xml file with no duplicate entries.
  3. Export and deploy this updated copy of application into WebSphere application server.

After performing these steps, you should be able to start the web application successfully.
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Servlet Engine/Web Container
Operating system(s): Windows
Software version: 6.0
Software edition:
Reference #: 1239297
IBM Group: Software Group
Modified date: Jun 7, 2006