Bug 1119851

Summary: SDK crashes when retrieving cluster list
Product: Red Hat Enterprise Virtualization Manager Reporter: Juan Hernández <juan.hernandez>
Component: ovirt-engine-sdk-javaAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Ondra Machacek <omachace>
Severity: high Docs Contact:
Priority: high    
Version: 3.5.0CC: gklein, iheim, msivak, pstehlik, yeylon
Target Milestone: ---Keywords: Rebase
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: rhevm-sdk-java-3.5.0.2-1.el6_5 Doc Type: Rebase: Bug Fixes and Enhancements
Doc Text:
Story Points: ---
Clone Of: 1119812 Environment:
Last Closed: 2015-02-16 13:36:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 1119812    
Bug Blocks: 1142923, 1156165    

Description Juan Hernández 2014-07-15 16:19:35 UTC
+++ This bug was initially created as a clone of Bug #1119812 +++

Description of problem:

Api engine = ovirtClient.connect();
for (Cluster cluster: engine.getClusters().list()) {

results in

[STDOUT] java.lang.NullPointerException
[STDOUT]        at org.ovirt.engine.sdk.web.HttpProxy.injectHeaders(HttpProxy.java:170)
[STDOUT]        at org.ovirt.engine.sdk.web.HttpProxy.execute(HttpProxy.java:113)
[STDOUT]        at org.ovirt.engine.sdk.web.HttpProxyBroker.get(HttpProxyBroker.java:414)
[STDOUT]        at org.ovirt.engine.sdk.common.CollectionDecorator.list(CollectionDecorator.java:180)
[STDOUT]        at org.ovirt.engine.sdk.common.CollectionDecorator.list(CollectionDecorator.java:154)
[STDOUT]        at org.ovirt.engine.sdk.decorators.Clusters.list(Clusters.java:75)
[STDOUT]        at org.ovirt.optimizer.service.ClusterDiscovery.getClusters(ClusterDiscovery.java:38)
[STDOUT]        at org.ovirt.optimizer.service.OptimizerServiceBean.discoveryTimeout(OptimizerServiceBean.java:75)
[STDOUT]        at org.ovirt.optimizer.service.OptimizerServiceBean$Proxy$_$$_WeldClientProxy.discoveryTimeout(Unknown Source)
[STDOUT]        at org.ovirt.optimizer.service.DiscoveryTimeout.execute(DiscoveryTimeout.java:18)
[STDOUT]        at org.quartz.core.JobRunShell.run(JobRunShell.java:207)
[STDOUT]        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:560)
[STDOUT] 2014-07-15 16:48:57 ERROR ErrorLogger:2460 - Job (DEFAULT.6da64b5bd2ee-cfd784b6-630f-4754-a50a-b10e9e4e731c threw an exception.
[STDOUT] org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NullPointerException]
[STDOUT]        at org.quartz.core.JobRunShell.run(JobRunShell.java:218)
[STDOUT]        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:560)
[STDOUT] Caused by: java.lang.NullPointerException
[STDOUT]        at org.ovirt.engine.sdk.web.HttpProxy.injectHeaders(HttpProxy.java:170)
[STDOUT]        at org.ovirt.engine.sdk.web.HttpProxy.execute(HttpProxy.java:113)
[STDOUT]        at org.ovirt.engine.sdk.web.HttpProxyBroker.get(HttpProxyBroker.java:414)
[STDOUT]        at org.ovirt.engine.sdk.common.CollectionDecorator.list(CollectionDecorator.java:180)
[STDOUT]        at org.ovirt.engine.sdk.common.CollectionDecorator.list(CollectionDecorator.java:154)
[STDOUT]        at org.ovirt.engine.sdk.decorators.Clusters.list(Clusters.java:75)
[STDOUT]        at org.ovirt.optimizer.service.ClusterDiscovery.getClusters(ClusterDiscovery.java:38)
[STDOUT]        at org.ovirt.optimizer.service.OptimizerServiceBean.discoveryTimeout(OptimizerServiceBean.java:75)
[STDOUT]        at org.ovirt.optimizer.service.OptimizerServiceBean$Proxy$_$$_WeldClientProxy.discoveryTimeout(Unknown Source)
[STDOUT]        at org.ovirt.optimizer.service.DiscoveryTimeout.execute(DiscoveryTimeout.java:18)
[STDOUT]        at org.quartz.core.JobRunShell.run(JobRunShell.java:207)
[STDOUT]        ... 1 more


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

ovirt-engine-sdk-java git bd756ad09cd35bf256bd5be842b5ccbbb203d8c5
ovirt-engine git 4f111044f99ff5245934f5e5267f23d8f458042e

How reproducible:

Compile and start the ovirt-engine

- I have only the Default cluster there and two hosts

Regenerate the SDK using all the right commands in the proper dirs:

mvn verify -Pupdate-metadata
mvn verify -Pupdate-code

mvn clean install

Write a small program that tries to get a list of clusters.

Actual results:

NPE

Expected results:

List of clusters

Comment 1 Juan Hernández 2014-07-18 07:21:38 UTC
This will be fixed with the next rebase from upstream.

Comment 2 Juan Hernández 2014-07-18 10:48:16 UTC
This will be fixed rebasing from upstream 3.5.0.2.

Comment 3 Ondra Machacek 2014-09-16 11:54:37 UTC
Works OK in:
rhevm-sdk-java-3.5.0.5-1.el6ev.noarch