This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes

Bug 856188

Summary: NullPointerException when trying to deploy war on EAP 6 in domain mode using CLI and createPackageBackedResource method
Product: [Other] RHQ Project Reporter: bkramer <bkramer>
Component: PluginsAssignee: RHQ Project Maintainer <rhq-maint>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.4CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 856186
: 856186 (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: ---

Description bkramer 2012-09-11 08:18:51 EDT
Description of problem:
I tried to deploy war file on EAP 6 in domain mode using the following:

var deploymentResourceType = ResourceTypeManager.getResourceTypeByNameAndPlugin('DomainDeployment', 'JBossAS7');

var criteria = new ResourceCriteria();
var domain = ResourceManager.findResourcesByCriteria(criteria).iterator().next();

var domainProxy = ProxyFactory.getResource(domain.getId());

var deployConfig = new Configuration();
deployConfig.put(new PropertySimple("runtimeName",;

var file = new"/home/HelloWorld.war");
var inputStream = new;
var fileLength = file.length();
var fileBytes = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, fileLength);
for (numRead=0, offset=0; ((numRead >= 0) && (offset < fileBytes.length)); offset += numRead ) {numRead =, offset, fileBytes.length - offset);}

var histo = ResourceFactoryManager.createPackageBackedResource(domain.getId(),,, null, "kitchensink", "1.0", null, deployConfig, fileBytes, 500000)
There is no error reported back and I can see the following line in server.log file:

[Host Controller] 11:56:47,996 INFO  [] (HttpManagementService-threads - 2) JBAS014900: Content added at location /home/JBoss/jboss-eap-6.0/domain/data/content/7a/8d0d406226c5c578bca957af3669d397af7d00/content

but agent.log file contains the following exception:

2012-09-11 11:56:48,162 DEBUG [ResourceFactory.executor-1] (rhq.core.pc.inventory.ResourceContainer$ResourceComponentInvocationHandler)- Call to [org.rhq.modules.plugins.jbossas7.HostControllerComponent.createResource()] with args [[CreateResourceReport: ResourceType=[{JBossAS7}DomainDeployment], ResourceKey=[null]]] failed.
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask$Sync.innerGet(
	at java.util.concurrent.FutureTask.get(
	at org.rhq.core.pc.inventory.ResourceContainer$ResourceComponentInvocationHandler.invokeInNewThreadWithLock(
	at org.rhq.core.pc.inventory.ResourceContainer$ResourceComponentInvocationHandler.invoke(
	at $Proxy72.createResource(Unknown Source)
	at java.util.concurrent.Executors$
	at java.util.concurrent.FutureTask$Sync.innerRun(
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
	at java.util.concurrent.ThreadPoolExecutor$
Caused by: java.lang.NullPointerException
	at org.rhq.modules.plugins.jbossas7.BaseComponent.deployContent(
	at org.rhq.modules.plugins.jbossas7.HostControllerComponent.createResource(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.rhq.core.pc.inventory.ResourceContainer$
	... 5 more

and "child history" will show unsuccessful attempt to create a child with the following:

2012-09-11 11:56:48,163 INFO  [ResourceFactory.executor-1] (rhq.core.pc.inventory.CreateResourceRunner)- Sending create response to server: CreateResourceResponse[RequestId=10121, Status=Failure]

and HelloWorld.war will not be visible.

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

How reproducible:
Every time.

Steps to Reproduce:
Actual results:
NPE is thrown and war file is not visible.

Expected results:
No exception is thrown and deployment is properly done.

Additional info: