Bug 1125421

Summary: (6.4.0) Missing param-name in a web.xml causes NullPointerException during deployment
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Jay SenSharma <jsenshar>
Component: WebAssignee: baranowb <bbaranow>
Status: CLOSED CURRENTRELEASE QA Contact: Michael Cada <mcada>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.2CC: bbaranow, istudens, pjelinek, roland.raez, sjadhav, ssilvert
Target Milestone: DR4   
Target Release: EAP 6.4.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1139636 (view as bug list) Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1139626, 1139636    
Attachments:
Description Flags
ContextParamNullDemo.war none

Description Jay SenSharma 2014-07-31 19:04:02 UTC
Description of problem:
----------------------
- While deploying a WAR, If the web.xml file is used which has context <param-value> defined, However it has missing <param-name> then it causes NullPointerException as following:

{code}
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"}}
{code}

Version-Release number of selected component (if applicable):


How reproducible:
- Yes

Steps to Reproduce:
------------------
- Deploy a WAR on WildFly with the following entry inside the web.xml file:

{code}
      <context-param>     
        <!--param-name>AnyName</param-name-->
        <param-value>AnyValue</param-value>
      </context-param>
{code}


Actual results:
----------------
- A NullPointerException is thrown, Without a useful user friendly information of what has become null or what is the reason of failure in user friendly manner.

Expected results:
----------------


Additional info:

Comment 1 Jay SenSharma 2014-07-31 19:05:11 UTC
- A useful/meaningful message should have been displayed during the deployment failure to the end user rather than unhandled NullPointerException

Comment 4 Jay SenSharma 2014-08-03 12:33:43 UTC
Created attachment 923611 [details]
ContextParamNullDemo.war

Comment 5 Farah Juma 2014-08-29 15:59:41 UTC
Since this is a JBoss metadata issue instead of a JSF issue, I'm updating the component to "Web".

Comment 6 baranowb 2014-09-09 10:59:03 UTC
8x: https://github.com/jboss/metadata/pull/68
7.x https://github.com/jboss/metadata/pull/69  7.1.x ->(eap 6.x)

Comment 8 Pavel Jelinek 2014-10-09 10:25:58 UTC
'javax.xml.stream.XMLStreamException: ParseError Message: param-name element missing' in context-param in EAP 6.4.0.DR4 is much better.