You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Mark Sztainbok <ma...@okta.com> on 2014/10/16 00:32:35 UTC

RE: Olingo is failing to throw exceptions for error response.

I never got a reply to this email either.

Any ideas what the cause is and how to fix it?

I can reproduce this issue 100% of the time.

From: Mark Sztainbok
Sent: Monday, September 08, 2014 2:43 PM
To: user@olingo.apache.org
Subject: Olingo is failing to throw exceptions for error response.

The service returned the following error response which according to the OData 3.0 spec is a valid response:
{"odata.error":{"code":"Request_BadRequest","message":{"lang":"en","value":"Bad Request - Error in query syntax."}}}

However, Olingo throws an UndeclaredThrowableException when processing the error response :

java.lang.reflect.UndeclaredThrowableException: null
        at org.apache.olingo.client.core.communication.header.ODataErrorResponseChecker.checkResponse(ODataErrorResponseChecker.java:73)
        at org.apache.olingo.client.core.communication.request.AbstractRequest.checkResponse(AbstractRequest.java:53)
        at org.apache.olingo.client.core.communication.request.AbstractODataRequest.doExecute(AbstractODataRequest.java:324)
        at org.apache.olingo.client.core.communication.request.retrieve.ODataEntitySetRequestImpl.execute(ODataEntitySetRequestImpl.java:61)
        at org.apache.olingo.client.core.communication.request.retrieve.ODataEntitySetRequestImpl.execute(ODataEntitySetRequestImpl.java:39)
        at org.apache.olingo.ext.proxy.commons.AbstractEntityCollectionInvocationHandler.fetchPartial(AbstractEntityCollectionInvocationHandler.java:117)
        at org.apache.olingo.ext.proxy.commons.AbstractCollectionInvocationHandler.execute(AbstractCollectionInvocationHandler.java:98)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.olingo.ext.proxy.commons.AbstractInvocationHandler.invokeSelfMethod(AbstractInvocationHandler.java:90)
        at org.apache.olingo.ext.proxy.commons.EntityCollectionInvocationHandler.invoke(EntityCollectionInvocationHandler.java:62)
        at com.sun.proxy.$Proxy32.execute(Unknown Source)
        at com.saasure.application.office365.msgraphapi.MsGraphApiClient.getAllGroups(MsGraphApiClient.java:239)
        at com.saasure.application.office365.msgraphapi.MsGraphApiClientTest.testGetAllGroups(MsGraphApiClientTest.java:202)

Looking at the source code, the method is trying to throw a ODataClientErrorException which is failing for some reason. I've included olingo-client-core, olingo-client-api and olingo-client-proxy as dependencies. Am I missing something? What would be cause of this failure?

Thanks,
Mark



RE: Olingo is failing to throw exceptions for error response.

Posted by Mark Sztainbok <ma...@okta.com>.
I'm not sure it is specific to the query. Based on the Java documentation, an UndeclaredThrowableExceptuon is thrown in the following case:

Thrown by a method invocation on a proxy instance if its invocation handler's invoke method throws a checked exception (a Throwable that is not assignable to RuntimeException or Error) that is not assignable to any of the exception types declared in the throws clause of the method that was invoked on the proxy instance and dispatched to the invocation handler.
An UndeclaredThrowableException instance contains the undeclared checked exception that was thrown by the invocation handler, and it can be retrieved with the getUndeclaredThrowable() method. UndeclaredThrowableException extends RuntimeException, so it is an unchecked exception that wraps a checked exception.

As of release 1.4, this exception has been retrofitted to conform to the general purpose exception-chaining mechanism. The "undeclared checked exception that was thrown by the invocation handler" that may be provided at construction time and accessed via the getUndeclaredThrowable() method is now known as the cause, and may be accessed via the Throwable.getCause() method, as well as the aforementioned "legacy method."


From: Bolz, Michael [mailto:michael.bolz@sap.com]
Sent: Wednesday, October 15, 2014 10:40 PM
To: user@olingo.apache.org
Subject: Re: Olingo is failing to throw exceptions for error response.

Hi,

can you please provide the URL and query you use for the request which course the "error in query syntax"?

Kind regards, Michael

On 16 Oct 2014, at 00:32, Mark Sztainbok <ma...@okta.com>> wrote:


I never got a reply to this email either.

Any ideas what the cause is and how to fix it?

I can reproduce this issue 100% of the time.

From: Mark Sztainbok
Sent: Monday, September 08, 2014 2:43 PM
To: user@olingo.apache.org<ma...@olingo.apache.org>
Subject: Olingo is failing to throw exceptions for error response.

The service returned the following error response which according to the OData 3.0 spec is a valid response:
{"odata.error":{"code":"Request_BadRequest","message":{"lang":"en","value":"Bad Request - Error in query syntax."}}}

However, Olingo throws an UndeclaredThrowableException when processing the error response :

java.lang.reflect.UndeclaredThrowableException: null
        at org.apache.olingo.client.core.communication.header.ODataErrorResponseChecker.checkResponse(ODataErrorResponseChecker.java:73)
        at org.apache.olingo.client.core.communication.request.AbstractRequest.checkResponse(AbstractRequest.java:53)
        at org.apache.olingo.client.core.communication.request.AbstractODataRequest.doExecute(AbstractODataRequest.java:324)
        at org.apache.olingo.client.core.communication.request.retrieve.ODataEntitySetRequestImpl.execute(ODataEntitySetRequestImpl.java:61)
        at org.apache.olingo.client.core.communication.request.retrieve.ODataEntitySetRequestImpl.execute(ODataEntitySetRequestImpl.java:39)
        at org.apache.olingo.ext.proxy.commons.AbstractEntityCollectionInvocationHandler.fetchPartial(AbstractEntityCollectionInvocationHandler.java:117)
        at org.apache.olingo.ext.proxy.commons.AbstractCollectionInvocationHandler.execute(AbstractCollectionInvocationHandler.java:98)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.olingo.ext.proxy.commons.AbstractInvocationHandler.invokeSelfMethod(AbstractInvocationHandler.java:90)
        at org.apache.olingo.ext.proxy.commons.EntityCollectionInvocationHandler.invoke(EntityCollectionInvocationHandler.java:62)
        at com.sun.proxy.$Proxy32.execute(Unknown Source)
        at com.saasure.application.office365.msgraphapi.MsGraphApiClient.getAllGroups(MsGraphApiClient.java:239)
        at com.saasure.application.office365.msgraphapi.MsGraphApiClientTest.testGetAllGroups(MsGraphApiClientTest.java:202)

Looking at the source code, the method is trying to throw a ODataClientErrorException which is failing for some reason. I've included olingo-client-core, olingo-client-api and olingo-client-proxy as dependencies. Am I missing something? What would be cause of this failure?

Thanks,
Mark




Re: Olingo is failing to throw exceptions for error response.

Posted by "Bolz, Michael" <mi...@sap.com>.
Hi,

can you please provide the URL and query you use for the request which course the “error in query syntax”?

Kind regards, Michael

On 16 Oct 2014, at 00:32, Mark Sztainbok <ma...@okta.com> wrote:

> I never got a reply to this email either.
>  
> Any ideas what the cause is and how to fix it?
>  
> I can reproduce this issue 100% of the time.
>  
> From: Mark Sztainbok 
> Sent: Monday, September 08, 2014 2:43 PM
> To: user@olingo.apache.org
> Subject: Olingo is failing to throw exceptions for error response.
>  
> The service returned the following error response which according to the OData 3.0 spec is a valid response:
> {"odata.error":{"code":"Request_BadRequest","message":{"lang":"en","value":"Bad Request - Error in query syntax."}}}
>  
> However, Olingo throws an UndeclaredThrowableException when processing the error response :
>  
> java.lang.reflect.UndeclaredThrowableException: null
>         at org.apache.olingo.client.core.communication.header.ODataErrorResponseChecker.checkResponse(ODataErrorResponseChecker.java:73)
>         at org.apache.olingo.client.core.communication.request.AbstractRequest.checkResponse(AbstractRequest.java:53)
>         at org.apache.olingo.client.core.communication.request.AbstractODataRequest.doExecute(AbstractODataRequest.java:324)
>         at org.apache.olingo.client.core.communication.request.retrieve.ODataEntitySetRequestImpl.execute(ODataEntitySetRequestImpl.java:61)
>         at org.apache.olingo.client.core.communication.request.retrieve.ODataEntitySetRequestImpl.execute(ODataEntitySetRequestImpl.java:39)
>         at org.apache.olingo.ext.proxy.commons.AbstractEntityCollectionInvocationHandler.fetchPartial(AbstractEntityCollectionInvocationHandler.java:117)
>         at org.apache.olingo.ext.proxy.commons.AbstractCollectionInvocationHandler.execute(AbstractCollectionInvocationHandler.java:98)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.olingo.ext.proxy.commons.AbstractInvocationHandler.invokeSelfMethod(AbstractInvocationHandler.java:90)
>         at org.apache.olingo.ext.proxy.commons.EntityCollectionInvocationHandler.invoke(EntityCollectionInvocationHandler.java:62)
>         at com.sun.proxy.$Proxy32.execute(Unknown Source)
>         at com.saasure.application.office365.msgraphapi.MsGraphApiClient.getAllGroups(MsGraphApiClient.java:239)
>         at com.saasure.application.office365.msgraphapi.MsGraphApiClientTest.testGetAllGroups(MsGraphApiClientTest.java:202)
>  
> Looking at the source code, the method is trying to throw a ODataClientErrorException which is failing for some reason. I’ve included olingo-client-core, olingo-client-api and olingo-client-proxy as dependencies. Am I missing something? What would be cause of this failure?
>  
> Thanks,
> Mark