Bug 1119812 - SDK crashes when retrieving cluster list
Summary: SDK crashes when retrieving cluster list
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-sdk-java
Version: 3.5
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 3.5.0
Assignee: Juan Hernández
QA Contact: Ondra Machacek
URL:
Whiteboard: infra
Depends On:
Blocks: 1119851
TreeView+ depends on / blocked
 
Reported: 2014-07-15 15:00 UTC by Martin Sivák
Modified: 2016-02-10 19:32 UTC (History)
2 users (show)

Fixed In Version: ovirt-engine-sdk-java-3.5.0.2-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1119851 (view as bug list)
Environment:
Last Closed: 2014-10-17 12:33:42 UTC
oVirt Team: Infra


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 30115 master MERGED sdk: Avoid NPE when receiving null lists Never
oVirt gerrit 30117 sdk_3.5 MERGED sdk: Avoid NPE when receiving null lists Never

Description Martin Sivák 2014-07-15 15:00:38 UTC
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 Ondra Machacek 2014-09-03 14:30:36 UTC
for(Cluster cluster: api.getClusters().list())
        {
            System.out.println(cluster.getName());
        }

> Default

verified in ovirt-engine-sdk-java-3.5.0.3-0.1.el6.noarch

Comment 2 Sandro Bonazzola 2014-10-17 12:33:42 UTC
oVirt 3.5 has been released and should include the fix for this issue.


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