Bug 669542

Summary: Deploying exploded WAR to JBoss EAP 5 throws NPE operation fails
Product: [Other] RHQ Project Reporter: James Lopez <saikron>
Component: PluginsAssignee: Filip Drabek <fdrabek>
Status: CLOSED CURRENTRELEASE QA Contact: Corey Welton <cwelton>
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: fdrabek, loleary, mfoley
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 769973 (view as bug list) Environment:
Last Closed: Type: ---
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: 743764    

Description James Lopez 2011-01-13 22:04:34 UTC
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)

Comment 1 Filip Drabek 2011-04-04 11:20:49 UTC
branch release-3.0.1 commit 8d936c05f084df1856d895cb10d60d72ebeddd64
branch release-3.0.0 commit 7a31e489c2fa86af2175554131e5ef6cce4480b1
branch master commit 933056376e4c0a9864e07c613e8fa4b7ff53f317

Comment 2 Mike Foley 2011-05-04 17:15:36 UTC
verified RHQ 4.0 community release, by following the steps to reproduce.  i uploaded sample.war

Comment 3 Corey Welton 2011-05-24 01:11:01 UTC
Bookkeeping - closing bug - fixed in recent release.

Comment 4 Corey Welton 2011-05-24 01:11:03 UTC
Bookkeeping - closing bug - fixed in recent release.