Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » SOAP IllegalArgumentException for array parameter
SOAP IllegalArgumentException for array parameter [message #1756430] Thu, 16 March 2017 18:35 Go to next message
yev xxxxx is currently offline yev xxxxxFriend
Messages: 17
Registered: July 2014
Junior Member
I am getting error from SOAP when trying to pass array parameter.

Quote:
Exception Description: Trying to invoke [setItmArr] on the object with the value [[itemName=xxx]
[itemType=R1]
[itemValue=25]
[req=null]].
The number of actual and formal parameters differs, or an unwrapping conversion has failed. Internal Exception:
java.lang.IllegalArgumentException: argument type mismatch Mapping: org.eclipse.persistence.oxm.mappings.XMLCompositeObjectMapping[ItmArr] Descriptor: XMLDescriptor(org.sh.web.types.NewItemInfo --> [])
In soap request I pass:

<ItmArr>
<itemName>xxx</itemName>
<itemValue>R1</itemValue>
<itemType>25</itemType>
</ItmArr>
Setter in 'org.sh.web.types.NewItemInfo'

private ItemInfo[] itmArr ;
  public void setItmArr(ItemInfo[] aItmArr)
  {
    this.itmArr = aItmArr;
  }


ItemInfo class fields:
private String itemName;
 private String itemType;
 private String itemValue;
 protected byte req;


following by setters/getters for private fields.

Why am I getting this error? how can I fix it?
I tired, using adapter class, tried to change protected field to private and adding setter/getter, tried to change type of 'req' from byte to Byte.

Nothing works.
Re: SOAP IllegalArgumentException for array parameter [message #1756481 is a reply to message #1756430] Fri, 17 March 2017 15:24 Go to previous message
yev xxxxx is currently offline yev xxxxxFriend
Messages: 17
Registered: July 2014
Junior Member
Update:

After debugging:


The error is coming internally from:

org.eclipse.persistence.internal.descriptor.MethodAttributeAccessor

method:

setAttributeValueInObject(Object domainObject, Object attributeValue, Object[] parameters)

on line:
this.setMethod.invoke(domainObject, parameters);

Where:

setMethod -

public void org.sh.web.types.NewItemInfo.setItmArr(org.sh.web.types.ItemInfo[])

domainObject is

org.sh.web.types.NewItemInfo

parameters is

(java.lang.Object[]), the member [0] of array is ItemInfo


I believe the issue is that the member of the above array is ItemInfo and not ItemInfo[].

Previous Topic:QueryHint INHERITANCE_OUTER_JOIN
Next Topic:Adding dependency to EclipseLink (ant+maven+Tycho)
Goto Forum:
  


Current Time: Fri Dec 15 06:34:10 GMT 2017

Powered by FUDForum. Page generated in 0.02204 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software