The Functions HASNEXT() / NEXT() Fail With Error When Used For A Collection Returned By A Web Service (Doc ID 1684369.1)

Last updated on OCTOBER 03, 2016

Applies to:

Oracle Fusion CRM Application Composer Cloud Service - Version 11.1.8.0.0 and later
Oracle Fusion CRM Application Composer - Version 11.1.8.0.0 and later
Information in this document applies to any platform.

Symptoms

When using  functions like hasnext() or next() in groovy scripts, for a collection returned by a web service call, the application throws the following error:

JBO-25184: Exception in expression "OpportunityVO" object function EnviarERP() : oracle.jbo.NoDefException

Error in the log file:
Error: groovy.lang.MissingMethodException: No signature of method:
java.util.ArrayList.hasNext() is applicable for argument types: () values: []
Possible solutions: last(), last(), inspect(), asList(), set(int,
java.lang.Object), set(int, java.lang.Object)

Steps to reproduce:

1. register the OpportunityService  and SalesPartyService webservices;

2. create the following function on Opportunity Object:

  def input = adf.webServices.Opportunity.getOpportunity(OptyId)
  println('adf.webServices.Opportunity.getOpportunity(OptyId)')
  def sales = adf.webServices.SalesParty.getSalesParty(input.TargetPartyId)
  println('adf.webServices.SalesParty.getSalesParty(input.TargetPartyId)')
  def sites=sales.OrganizationParty.PartySite
  println ('sites')
  println (sites)
  println ('sites.hasNext()')
  println (sites.hasNext())

3. create a new action and add it to the opportunity edit form page;

4. open an opportunity linked to a sales account having sites, get the following error:
JBO-25184: Exception in expression "OpportunityVO" object function EnviarERP() : oracle.jbo.NoDefException.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms