hi all,
i have been using the queryService for some time and I have always had errors in the logs which i should be able to cleanup but I think their may be a bug in the vco source.
lets assume I have 3 records in s result set for a call such as.
var resultSet = queryService.queryRecords(VclQueryRecordType.ADMINVM, params);
while (resultSet != null)
{
var records = result.getRecords(new VclQueryResultAdminVMRecord());
for each (var record in records)
//blah
next
resultSet.getNextPage();
}
whenever I hit the last record and there is no more records there is always an error produced in the logs.
2014-01-09 11:14:59.141+1000 INFO [SCRIPTING_LOG] [QPS blockingTask (Approval: vApp instantiate)/Configure Dashboard on Instantiate vApp (9/01/14 11:13:19)] hasNextPage: false
2014-01-09 11:14:59.141+1000 WARN [AbstractRecordResultDecorator] Reference Not Found
com.vmware.vcloud.sdk.VCloudException: Reference Not Found
at com.vmware.vcloud.sdk.RecordResult.getNextPage(RecordResult.java:137)
at com.vmware.vmo.plugin.vcloud.model.query.AbstractRecordResultDecorator.getNextPage(AbstractRecordResultDecorator.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at ch.dunes.vso.sdk.WrappedJavaMethod.call(WrappedJavaMethod.java:142)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1701)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3178)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
at org.mozilla.javascript.Context.evaluateString(Context.java:1111)
at ch.dunes.scripting.server.script.MainScriptingObject.executeScript(MainScriptingObject.java:236)
at ch.dunes.scripting.server.script.MainScriptingObject.executeScript(MainScriptingObject.java:223)
at ch.dunes.workflow.engine.mbean.WorkflowScriptRunner.execute(WorkflowScriptRunner.java:188)
at ch.dunes.workflow.engine.mbean.runner.WorkflowItemTaskRunner.execute(WorkflowItemTaskRunner.java:45)
at ch.dunes.workflow.engine.mbean.runner.WorkflowItemTaskRunner.execute(WorkflowItemTaskRunner.java:24)
at ch.dunes.workflow.engine.mbean.helper.WorkflowHandler.requestElementExecution(WorkflowHandler.java:875)
at ch.dunes.workflow.engine.mbean.helper.WorkflowHandler.handleWorkflowTokenNextStep(WorkflowHandler.java:619)
at ch.dunes.workflow.engine.mbean.helper.WorkflowHandler.executeToken(WorkflowHandler.java:500)
at ch.dunes.workflow.engine.mbean.helper.WorkflowHandler.handleTokenExecution(WorkflowHandler.java:416)
at ch.dunes.workflow.engine.mbean.helper.WorkflowHandler.access$200(WorkflowHandler.java:89)
at ch.dunes.workflow.engine.mbean.helper.WorkflowHandler$1.execute(WorkflowHandler.java:330)
at ch.dunes.model.ar.AccessRightsTemplate.executeWithAccessRights(AccessRightsTemplate.java:16)
at ch.dunes.workflow.engine.mbean.helper.WorkflowHandler.doExecute(WorkflowHandler.java:326)
at ch.dunes.workflow.engine.mbean.helper.WorkflowHandler.run(WorkflowHandler.java:230)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I figure I should be able to remove these errors by querying the
resultSet.hasNextPage() method but this doesnt seem to work.
anyone else tried to remove these message.. they just make trawling logfiles more tedious than it already is.
I figure i should be able to do something like this
if (resultSet.hasNextPage)
{
resultSet = resultSet.getNextPage();
}
or
if (resultSet.hasNextPage() == true)
{
resultSet = resultSet.getNextPage();
}