Bug 783942

Summary: NPE in DriftManager when called from Standalone PC
Product: [Other] RHQ Project Reporter: Heiko W. Rupp <hrupp>
Component: driftAssignee: John Sanda <jsanda>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 4.3CC: jsanda
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-01 15:22:48 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Attachments:
Description Flags
A patch that works for me
none
A patch that works for me none

Description Heiko W. Rupp 2012-01-23 05:18:38 EST
snert:/im/rhq/modules/enterprise/agent/target/rhq-agent hrupp$ bin/standalone.sh 
Listening for transport dt_socket at address: 8788

Starting the plugin container.
Loading plugins
Exception in thread "main" java.lang.NullPointerException
	at org.rhq.core.pc.drift.DriftManager.scanForContentToResend(DriftManager.java:239)
	at org.rhq.core.pc.drift.DriftManager.initialize(DriftManager.java:107)
	at org.rhq.core.pc.PluginContainer.startContainerService(PluginContainer.java:431)
	at org.rhq.core.pc.PluginContainer.initialize(PluginContainer.java:291)
	at org.rhq.core.pc.StandaloneContainer.run(StandaloneContainer.java:139)
	at org.rhq.core.pc.StandaloneContainer.main(StandaloneContainer.java:90)


While this may be an issue how the Drift stuff is initialized by the standalone PC, this may also occur in plugin unit tests, where the plugin writer decided to fire a plugin-container for testing.
Comment 1 Heiko W. Rupp 2012-01-23 05:31:06 EST
changesetDir.listFiles() returns null. Javadoc says:

" Returns null if this abstract pathname does not denote a directory, or if an I/O error occurs."

A patch that works for me is attached.
Comment 2 Heiko W. Rupp 2012-01-23 05:31:56 EST
Created attachment 556904 [details]
A patch that works for me
Comment 3 Heiko W. Rupp 2012-01-23 06:12:23 EST
Created attachment 556922 [details]
A patch that works for me
Comment 4 Mike Foley 2012-01-23 11:17:31 EST
per scrum 1/23/2012 crouch, loleary, mfoley
Comment 5 John Sanda 2012-02-15 15:46:55 EST
I have applied Heiko's patch in the master branch.

commit hash: 11f486f3c204d021e5e1435c9819ed9a3dfe97ee
Comment 6 Heiko W. Rupp 2013-09-01 15:22:48 EDT
Bulk closing of BZs that have no target version set, but which are ON_QA for more than a year and thus are in production for a long time.