Bug 769973

Summary: Deploying exploded WAR to JBoss EAP 5 throws NPE operation fails
Product: [Other] RHQ Project Reporter: Charles Crouch <ccrouch>
Component: PluginsAssignee: Lukas Krejci <lkrejci>
Status: CLOSED WONTFIX QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: fdrabek, hbrock, hrupp, loleary, mfoley, saikron, snegrea
Target Milestone: ---   
Target Release: JON 2.4.2   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 669542 Environment:
Last Closed: 2012-01-09 14:52:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Charles Crouch 2011-12-22 21:01:11 UTC
+++ This bug was initially created as a clone of Bug #669542 +++

Description of problem: When deploying an exploded WAR file as a child resource of my jboss as5, the operation says it fails. The error popup window says "java.lang.NullPointerException." The WAR gets deployed, but the MANIFEST.MF isn't updated, and the operation status is "Failure".


Environment: JON 2.4.0, JBoss 5.0/5.1 (tried both), RHEL 5.5, Postgres 8.4.5, java1.6u23, as5 plugin says 3.0.0.GA Build Number: 8fb6059 


How reproducible: Any time I deploy an exploded WAR as a child resource 


Steps to Reproduce:
1. Open the inventory tab of jboss server and use the dropdown to create a new war
2. Upload a war
3. Put noarch (or anything it seems) in the version box, select radio button to deploy exploded
4. Click create
  
Actual results: The WAR is deployed, the operation fails, the manifest doesn't get modified. The WAR doesn't show up in the inventory until it's detected automatically much later.


Expected results: The WAR is deployed, the operation succeeds, the manifest has some version info in it. Should the war show up in inventory right away? I thought it would.


Additional info: The RHQ git repo was still down this morning, but I have skimmed the source code here: http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=blob;f=modules/plugins/jboss-as-5/src/main/java/org/rhq/plugins/jbossas5/deploy/AbstractDeployer.java;h=5dff4ef19b8995f9afdffb681c4f27645862760c;hb=agentPlugin

Is this the nearest source that went into the JON 2.4.0 plugin?

Line 131: String deploymentName = deployTimeConfig.getSimple(DEPLOYMENT_NAME_PROPERTY).getStringValue();
//Throws NPE if deploymentName = null
URI deployePackageURI = URI.create(deploymentName);
//getPath() returns null if the URI is undefined
String path = deployePackageURI.getPath();
//new File(null) throws NPE
File location = new File(path);

An error in the agent log references the exception.

2011-01-11 12:25:16,503 ERROR [ResourceContainer.invoker.nonDaemon-1] (rhq.plugins.jbossas5.deploy.RemoteDeployer)- Error deploying application for request [CreateResourceReport: ResourceType=[Reso
urceType[id=0, category=Service, name=Web Application (WAR), plugin=JBossAS5]], ResourceKey=[null]].
java.lang.NullPointerException
        at org.rhq.plugins.jbossas5.deploy.AbstractDeployer.deploy(AbstractDeployer.java:131)
        at org.rhq.plugins.jbossas5.helper.CreateChildResourceFacetDelegate.createContentBasedResource(CreateChildResourceFacetDelegate.java:124)
        at org.rhq.plugins.jbossas5.helper.CreateChildResourceFacetDelegate.createResource(CreateChildResourceFacetDelegate.java:56)
        at org.rhq.plugins.jbossas5.ApplicationServerComponent.createResource(ApplicationServerComponent.java:304)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:525)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

--- Additional comment from fdrabek on 2011-04-04 07:20:49 EDT ---

branch release-3.0.1 commit 8d936c05f084df1856d895cb10d60d72ebeddd64
branch release-3.0.0 commit 7a31e489c2fa86af2175554131e5ef6cce4480b1
branch master commit 933056376e4c0a9864e07c613e8fa4b7ff53f317

--- Additional comment from mfoley on 2011-05-04 13:15:36 EDT ---

verified RHQ 4.0 community release, by following the steps to reproduce.  i uploaded sample.war

--- Additional comment from cwelton on 2011-05-23 21:11:01 EDT ---

Bookkeeping - closing bug - fixed in recent release.

--- Additional comment from cwelton on 2011-05-23 21:11:03 EDT ---

Bookkeeping - closing bug - fixed in recent release.

Comment 5 Charles Crouch 2012-01-09 14:52:24 UTC
Closing as wontfix as per comments from Stefan and Lukas