IllegalArgumentException: no valid OData JSON format when executing callFunction request

109 views
Skip to first unread message

Gilad Adler

unread,
Aug 27, 2013, 5:39:21 AM8/27/13
to odata4j...@googlegroups.com
I'm trying to initiate a callFunction request ( using odata4j-0.7.0-clientbundle ):
...
OFunctionRequest<OObject> functionRequest = consumer.callFunction(functionName);
...
Enumerable<OObject> functionResponse = functionRequest.execute();

But it fails with IllegalArgumentException.

The server response is :
{
"d" : {
"simpleResponse@authenticate" : {
"Success" : false, "Value Type" : "", "Value" : "null", "Reason" : "This method requires the presence of an attribute which was not provided. The attribute is named TBLUSERS.DISABLED."
}
}
}

What I see over my console is :

Accept: application/json
Authorization: Basic dXNlcjpwYXNzd29yZA==
User-Agent: odata4j.org
java.lang.IllegalArgumentException: no valid OData JSON format (expected EndProperty got StartObject('{'))
at org.odata4j.format.json.JsonFormatParser.ensureEndProperty(JsonFormatParser.java:432)
at org.odata4j.format.json.JsonSimpleObjectFormatParser.parse(JsonSimpleObjectFormatParser.java:41)
at org.odata4j.format.json.JsonSimpleObjectFormatParser.parse(JsonSimpleObjectFormatParser.java:15)
at org.odata4j.consumer.ConsumerFunctionCallRequest.doRequest(ConsumerFunctionCallRequest.java:203)
at org.odata4j.consumer.ConsumerFunctionCallRequest.execute(ConsumerFunctionCallRequest.java:78)


I know that the response is a valid JSON, where is the catch ???

John Spurlock

unread,
Aug 27, 2013, 5:50:00 AM8/27/13
to odata4j...@googlegroups.com

What happens if you remove the @ sign from the property name?

--
You received this message because you are subscribed to the Google Groups "odata4j-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to odata4j-discu...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Amit Dwivedi

unread,
Apr 19, 2016, 5:21:51 AM4/19/16
to odata4j-discuss
Hi Adler,

Did u get any resolution even I am getting the same error.

Thanks,
Amit
Reply all
Reply to author
Forward
0 new messages