Why missing param-name in a web.xml is causing a NullPointerException

Solution Unverified - Updated -

Issue

  • In case in a "web.xml" a "<context-param>" is missing the "<param-name>" element, the deployment is failing with the following error message:
00:28:18,063 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "ContextParamNullDemo.war" (runtime-name: "ContextParamNullDemo.war")
00:28:18,239 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."ContextParamNullDemo.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."ContextParamNullDemo.war".PARSE: JBAS018733: Failed to process phase PARSE of deployment "ContextParamNullDemo.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.3.2.Final-redhat-2.jar:7.3.2.Final-redhat-2]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
    at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
Caused by: java.lang.NullPointerException
    at org.jboss.as.jsf.deployment.JSFVersionProcessor.deploy(JSFVersionProcessor.java:91)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.3.2.Final-redhat-2.jar:7.3.2.Final-redhat-2]
    ... 5 more

00:28:18,249 ERROR [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy of deployment "ContextParamNullDemo.war" was rolled back with the following failure message: 
{"JBAS014671: Failed services" => {"jboss.deployment.unit.\"ContextParamNullDemo.war\".PARSE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"ContextParamNullDemo.war\".PARSE: JBAS018733: Failed to process phase PARSE of deployment \"ContextParamNullDemo.war\"
    Caused by: java.lang.NullPointerException"}}
  • Is there any specific reason that it throws "NullPointerException" rather than explaining the actual root cause of the deployment failure.
  • It would be nice if future version of JBoss would report as the reason for the failed deployment a missing parameter name.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.0.x
    • 6.1.x
    • 6.2.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.