Bug 669542 - Deploying exploded WAR to JBoss EAP 5 throws NPE operation fails
Summary: Deploying exploded WAR to JBoss EAP 5 throws NPE operation fails
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: unspecified
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
: ---
Assignee: Filip Drabek
QA Contact: Corey Welton
URL:
Whiteboard:
Depends On:
Blocks: 743764
TreeView+ depends on / blocked
 
Reported: 2011-01-13 22:04 UTC by James Lopez
Modified: 2018-11-14 15:02 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 769973 (view as bug list)
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker EMBJOPR-339 0 Critical Closed Deploying an EAR in exploded form fails with NPE 2016-03-02 15:38:38 UTC

Internal Links: 791340

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.


Note You need to log in before you can comment on or make changes to this bug.