pub.list:sizeOfList is failing and the error it produces is cannot be cast to [Ljava.lang.Object;

Can anyone tell me what this error means?? I am passing the data from a listdocument to this service and capturing the output as size of a list in a sting variable.

Hi Monica,

are you sure you are passing an array object to sizeOfList. the error means that the input to the sizeOfList is not a List object…


I am facing a similar issue.

I have XML data as input to a service and it contains a document list somewhere inside. i use a pub.list:sizeOfList to get the size of this list (i have done XMLStringToXMLNode and XMLNodeToXMLDocument).

the service runs well when the input XML has multiple records for the document list,
but when the input XML file contains only one record in the document list, i get an error:

at pub.list.sizeOfList(

Can anyone suggest what could be the problem?

In the call to XMLNodeToDocument you need to specify the IS document type name that the XML conforms to. That way the service will know to create a list even when only one entry is present.

Thanks Rob !! that was the perfect solution :slight_smile:

Specified the IS doc type and makeArrays=false

Thank you