HTTP/1.1 422 Unprocessable Entity - Error

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

HTTP/1.1 422 Unprocessable Entity - Error

Xybrek
How to fix when GWT ClientProxy resource gets this "HTTP/1.1 422
Unprocessable Entity" error?

Is it fine to have these two dependency in the project (or just one?):

       <dependency>
           <groupId>org.restlet.gae</groupId>
           <artifactId>org.restlet.ext.jackson</artifactId>
           <version>2.2.0</version>
       </dependency>
       <dependency>
           <groupId>org.restlet.gae</groupId>
           <artifactId>org.restlet.ext.json</artifactId>
           <version>2.2.1</version>
       </dependency>


If this is not the issue what could be the problem that GWT ClientProxy
is getting this error? The Actual method in the ServerResource doesn't
seem to get invoked at all, since the LOG would not show. So Where is
this "HTTP/1.1 422 Unprocessable Entity" being caught if not on the
actual ServerResource, how to deal with this?

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3094172
Reply | Threaded
Open this post in threaded view
|

Re: HTTP/1.1 422 Unprocessable Entity - Error

Xybrek
On Wednesday, 14 January, 2015 04:42 AM, Xybrek wrote:

> How to fix when GWT ClientProxy resource gets this "HTTP/1.1 422
> Unprocessable Entity" error?
>
> Is it fine to have these two dependency in the project (or just one?):
>
>         <dependency>
>             <groupId>org.restlet.gae</groupId>
>             <artifactId>org.restlet.ext.jackson</artifactId>
>             <version>2.2.0</version>
>         </dependency>
>         <dependency>
>             <groupId>org.restlet.gae</groupId>
>             <artifactId>org.restlet.ext.json</artifactId>
>             <version>2.2.1</version>
>         </dependency>
>
>
> If this is not the issue what could be the problem that GWT ClientProxy
> is getting this error? The Actual method in the ServerResource doesn't
> seem to get invoked at all, since the LOG would not show. So Where is
> this "HTTP/1.1 422 Unprocessable Entity" being caught if not on the
> actual ServerResource, how to deal with this?
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3094172
>

I tried to update to 2.3-M2 then the error is different. And throws this
error:

INFO] INFO: Error while handling an HTTP server call
[INFO] java.lang.ClassCastException: org.restlet.data.Header cannot be
cast to org.restlet.engine.header.Header
[INFO] at
org.restlet.engine.header.HeaderUtils.getContentLength(HeaderUtils.java:869)
[INFO] at
org.restlet.engine.adapter.ServerCall.getContentLength(ServerCall.java:151)
[INFO] at
org.restlet.engine.adapter.ServerCall.getRequestEntity(ServerCall.java:187)
[INFO] at
org.restlet.ext.servlet.internal.ServletCall.getRequestEntity(ServletCall.java:226)
[INFO] at
org.restlet.engine.adapter.HttpRequest.getEntity(HttpRequest.java:503)
[INFO] at
org.restlet.service.LogService.getDefaultResponseLogMessage(LogService.java:228)
[INFO] at
org.restlet.service.LogService.getResponseLogMessage(LogService.java:320)
[INFO] at org.restlet.engine.log.LogFilter.afterHandle(LogFilter.java:106)
[INFO] at org.restlet.routing.Filter.handle(Filter.java:208)
[INFO] at
org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:211)
[INFO] at org.restlet.Component.handle(Component.java:401)
[INFO] at org.restlet.Server.handle(Server.java:516)
[INFO] at
org.restlet.engine.connector.ServerHelper.handle(ServerHelper.java:72)
[INFO] at
org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:152)
[INFO] at
org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1123)
[INFO] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
[INFO] at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
[INFO] at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
[INFO] at
com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
[INFO] at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO] at
com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:127)
[INFO] at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO] at
com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
[INFO] at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO] at
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
[INFO] at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO] at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
[INFO] at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO] at
com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
[INFO] at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO] at
com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.java:366)
[INFO] at
com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFilter.java:349)
[INFO] at
com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:116)
[INFO] at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO] at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
[INFO] at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
[INFO] at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
[INFO] at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
[INFO] at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
[INFO] at
com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
[INFO] at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
[INFO] at
com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:491)
[INFO] at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
[INFO] at org.mortbay.jetty.Server.handle(Server.java:326)
[INFO] at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
[INFO] at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
[INFO] at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
[INFO] at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
[INFO] at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
[INFO] at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
[INFO] at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3094175
Reply | Threaded
Open this post in threaded view
|

Re: HTTP/1.1 422 Unprocessable Entity - Error

Xybrek
On Wednesday, 14 January, 2015 05:08 AM, Xybrek wrote:

> On Wednesday, 14 January, 2015 04:42 AM, Xybrek wrote:
>> How to fix when GWT ClientProxy resource gets this "HTTP/1.1 422
>> Unprocessable Entity" error?
>>
>> Is it fine to have these two dependency in the project (or just one?):
>>
>>          <dependency>
>>              <groupId>org.restlet.gae</groupId>
>>              <artifactId>org.restlet.ext.jackson</artifactId>
>>              <version>2.2.0</version>
>>          </dependency>
>>          <dependency>
>>              <groupId>org.restlet.gae</groupId>
>>              <artifactId>org.restlet.ext.json</artifactId>
>>              <version>2.2.1</version>
>>          </dependency>
>>
>>
>> If this is not the issue what could be the problem that GWT ClientProxy
>> is getting this error? The Actual method in the ServerResource doesn't
>> seem to get invoked at all, since the LOG would not show. So Where is
>> this "HTTP/1.1 422 Unprocessable Entity" being caught if not on the
>> actual ServerResource, how to deal with this?
>>
>> ------------------------------------------------------
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3094172
>>
>
> I tried to update to 2.3-M2 then the error is different. And throws this
> error:
>
> INFO] INFO: Error while handling an HTTP server call
> [INFO] java.lang.ClassCastException: org.restlet.data.Header cannot be
> cast to org.restlet.engine.header.Header
> [INFO] at
> org.restlet.engine.header.HeaderUtils.getContentLength(HeaderUtils.java:869)
> [INFO] at
> org.restlet.engine.adapter.ServerCall.getContentLength(ServerCall.java:151)
> [INFO] at
> org.restlet.engine.adapter.ServerCall.getRequestEntity(ServerCall.java:187)
> [INFO] at
> org.restlet.ext.servlet.internal.ServletCall.getRequestEntity(ServletCall.java:226)
> [INFO] at
> org.restlet.engine.adapter.HttpRequest.getEntity(HttpRequest.java:503)
> [INFO] at
> org.restlet.service.LogService.getDefaultResponseLogMessage(LogService.java:228)
> [INFO] at
> org.restlet.service.LogService.getResponseLogMessage(LogService.java:320)
> [INFO] at org.restlet.engine.log.LogFilter.afterHandle(LogFilter.java:106)
> [INFO] at org.restlet.routing.Filter.handle(Filter.java:208)
> [INFO] at
> org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:211)
> [INFO] at org.restlet.Component.handle(Component.java:401)
> [INFO] at org.restlet.Server.handle(Server.java:516)
> [INFO] at
> org.restlet.engine.connector.ServerHelper.handle(ServerHelper.java:72)
> [INFO] at
> org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:152)
> [INFO] at
> org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1123)
> [INFO] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> [INFO] at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
> [INFO] at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
> [INFO] at
> com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
> [INFO] at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> [INFO] at
> com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:127)
> [INFO] at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> [INFO] at
> com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
> [INFO] at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> [INFO] at
> com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
> [INFO] at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> [INFO] at
> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
> [INFO] at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> [INFO] at
> com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
> [INFO] at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> [INFO] at
> com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.java:366)
> [INFO] at
> com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFilter.java:349)
> [INFO] at
> com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:116)
> [INFO] at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
> [INFO] at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
> [INFO] at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
> [INFO] at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
> [INFO] at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> [INFO] at
> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
> [INFO] at
> com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
> [INFO] at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> [INFO] at
> com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:491)
> [INFO] at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> [INFO] at org.mortbay.jetty.Server.handle(Server.java:326)
> [INFO] at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
> [INFO] at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
> [INFO] at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
> [INFO] at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
> [INFO] at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> [INFO] at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> [INFO] at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3094175
>


I also have tried downgrading to 2.2.2 and the Error 422 comes back,
what could the solution for this?

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3094177
Reply | Threaded
Open this post in threaded view
|

Re: HTTP/1.1 422 Unprocessable Entity - Error

Xybrek
On Wednesday, 14 January, 2015 05:25 AM, Xybrek wrote:

> On Wednesday, 14 January, 2015 05:08 AM, Xybrek wrote:
>> On Wednesday, 14 January, 2015 04:42 AM, Xybrek wrote:
>>> How to fix when GWT ClientProxy resource gets this "HTTP/1.1 422
>>> Unprocessable Entity" error?
>>>
>>> Is it fine to have these two dependency in the project (or just one?):
>>>
>>>           <dependency>
>>>               <groupId>org.restlet.gae</groupId>
>>>               <artifactId>org.restlet.ext.jackson</artifactId>
>>>               <version>2.2.0</version>
>>>           </dependency>
>>>           <dependency>
>>>               <groupId>org.restlet.gae</groupId>
>>>               <artifactId>org.restlet.ext.json</artifactId>
>>>               <version>2.2.1</version>
>>>           </dependency>
>>>
>>>
>>> If this is not the issue what could be the problem that GWT ClientProxy
>>> is getting this error? The Actual method in the ServerResource doesn't
>>> seem to get invoked at all, since the LOG would not show. So Where is
>>> this "HTTP/1.1 422 Unprocessable Entity" being caught if not on the
>>> actual ServerResource, how to deal with this?
>>>
>>> ------------------------------------------------------
>>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3094172
>>>
>>
>> I tried to update to 2.3-M2 then the error is different. And throws this
>> error:
>>
>> INFO] INFO: Error while handling an HTTP server call
>> [INFO] java.lang.ClassCastException: org.restlet.data.Header cannot be
>> cast to org.restlet.engine.header.Header
>> [INFO] at
>> org.restlet.engine.header.HeaderUtils.getContentLength(HeaderUtils.java:869)
>> [INFO] at
>> org.restlet.engine.adapter.ServerCall.getContentLength(ServerCall.java:151)
>> [INFO] at
>> org.restlet.engine.adapter.ServerCall.getRequestEntity(ServerCall.java:187)
>> [INFO] at
>> org.restlet.ext.servlet.internal.ServletCall.getRequestEntity(ServletCall.java:226)
>> [INFO] at
>> org.restlet.engine.adapter.HttpRequest.getEntity(HttpRequest.java:503)
>> [INFO] at
>> org.restlet.service.LogService.getDefaultResponseLogMessage(LogService.java:228)
>> [INFO] at
>> org.restlet.service.LogService.getResponseLogMessage(LogService.java:320)
>> [INFO] at org.restlet.engine.log.LogFilter.afterHandle(LogFilter.java:106)
>> [INFO] at org.restlet.routing.Filter.handle(Filter.java:208)
>> [INFO] at
>> org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:211)
>> [INFO] at org.restlet.Component.handle(Component.java:401)
>> [INFO] at org.restlet.Server.handle(Server.java:516)
>> [INFO] at
>> org.restlet.engine.connector.ServerHelper.handle(ServerHelper.java:72)
>> [INFO] at
>> org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:152)
>> [INFO] at
>> org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1123)
>> [INFO] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>> [INFO] at
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
>> [INFO] at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
>> [INFO] at
>> com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
>> [INFO] at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>> [INFO] at
>> com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:127)
>> [INFO] at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>> [INFO] at
>> com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
>> [INFO] at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>> [INFO] at
>> com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
>> [INFO] at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>> [INFO] at
>> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
>> [INFO] at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>> [INFO] at
>> com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
>> [INFO] at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>> [INFO] at
>> com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.java:366)
>> [INFO] at
>> com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFilter.java:349)
>> [INFO] at
>> com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:116)
>> [INFO] at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>> [INFO] at
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
>> [INFO] at
>> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>> [INFO] at
>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
>> [INFO] at
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
>> [INFO] at
>> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
>> [INFO] at
>> com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
>> [INFO] at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>> [INFO] at
>> com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:491)
>> [INFO] at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>> [INFO] at org.mortbay.jetty.Server.handle(Server.java:326)
>> [INFO] at
>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
>> [INFO] at
>> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
>> [INFO] at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
>> [INFO] at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
>> [INFO] at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>> [INFO] at
>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>> [INFO] at
>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
>>
>> ------------------------------------------------------
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3094175
>>
>
>
> I also have tried downgrading to 2.2.2 and the Error 422 comes back,
> what could the solution for this?
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3094177
>

After quite tries it seems Restlet cannot serialize some parts of the
POJO, is there way to make Restlet log the specific part that can't be
serialized?

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3094180
Reply | Threaded
Open this post in threaded view
|

Re: HTTP/1.1 422 Unprocessable Entity - Error

Thierry Boileau-4
Hello,

If I understand well, your scenario is as follow:
 - there is a Web API hosted on GAE
 - the server side code leverages the Jackson converter to serialize/deserialize Java beans
 - there is a GWT application which communicates with the back-end.

Some things are not clear to me:
 - how does the GWT application communicates with the back-end? Are you sending your own json representations to the backend?
 - does the GWT application exchanges beans using the default gwt serialization format? (in this case, the server side code must add the org.restlet.ext.gwt extension) Actually this is the simplest way to develop GWT/GAE applications, as you are only handling beans on both sides, while keeping your API communicate with other format supported by the Jackson converter (json, xml, yaml, etc). You can have a look here http://restlet.com/technical-resources/restlet-framework/guide/2.3/introduction/first-steps/first-application.

In order to debug, you can set the log level to the minimum (cf http://restlet.com/technical-resources/restlet-framework/guide/2.3/editions/jse/logging), and/or update the properties of the bean in order to identify either the type, or value that leads to the conversion error.

I hope this will help you.


2015-01-13 22:57 GMT+01:00 Xybrek <[hidden email]>:
On Wednesday, 14 January, 2015 05:25 AM, Xybrek wrote:
> On Wednesday, 14 January, 2015 05:08 AM, Xybrek wrote:
>> On Wednesday, 14 January, 2015 04:42 AM, Xybrek wrote:
>>> How to fix when GWT ClientProxy resource gets this "HTTP/1.1 422
>>> Unprocessable Entity" error?
>>>
>>> Is it fine to have these two dependency in the project (or just one?):
>>>
>>>           <dependency>
>>>               <groupId>org.restlet.gae</groupId>
>>>               <artifactId>org.restlet.ext.jackson</artifactId>
>>>               <version>2.2.0</version>
>>>           </dependency>
>>>           <dependency>
>>>               <groupId>org.restlet.gae</groupId>
>>>               <artifactId>org.restlet.ext.json</artifactId>
>>>               <version>2.2.1</version>
>>>           </dependency>
>>>
>>>
>>> If this is not the issue what could be the problem that GWT ClientProxy
>>> is getting this error? The Actual method in the ServerResource doesn't
>>> seem to get invoked at all, since the LOG would not show. So Where is
>>> this "HTTP/1.1 422 Unprocessable Entity" being caught if not on the
>>> actual ServerResource, how to deal with this?
>>>
>>> ------------------------------------------------------
>>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3094172
>>>
>>
>> I tried to update to 2.3-M2 then the error is different. And throws this
>> error:
>>
>> INFO] INFO: Error while handling an HTTP server call
>> [INFO] java.lang.ClassCastException: org.restlet.data.Header cannot be
>> cast to org.restlet.engine.header.Header
>> [INFO]       at
>> org.restlet.engine.header.HeaderUtils.getContentLength(HeaderUtils.java:869)
>> [INFO]       at
>> org.restlet.engine.adapter.ServerCall.getContentLength(ServerCall.java:151)
>> [INFO]       at
>> org.restlet.engine.adapter.ServerCall.getRequestEntity(ServerCall.java:187)
>> [INFO]       at
>> org.restlet.ext.servlet.internal.ServletCall.getRequestEntity(ServletCall.java:226)
>> [INFO]       at
>> org.restlet.engine.adapter.HttpRequest.getEntity(HttpRequest.java:503)
>> [INFO]       at
>> org.restlet.service.LogService.getDefaultResponseLogMessage(LogService.java:228)
>> [INFO]       at
>> org.restlet.service.LogService.getResponseLogMessage(LogService.java:320)
>> [INFO]       at org.restlet.engine.log.LogFilter.afterHandle(LogFilter.java:106)
>> [INFO]       at org.restlet.routing.Filter.handle(Filter.java:208)
>> [INFO]       at
>> org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:211)
>> [INFO]       at org.restlet.Component.handle(Component.java:401)
>> [INFO]       at org.restlet.Server.handle(Server.java:516)
>> [INFO]       at
>> org.restlet.engine.connector.ServerHelper.handle(ServerHelper.java:72)
>> [INFO]       at
>> org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:152)
>> [INFO]       at
>> org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1123)
>> [INFO]       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>> [INFO]       at
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
>> [INFO]       at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
>> [INFO]       at
>> com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
>> [INFO]       at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>> [INFO]       at
>> com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:127)
>> [INFO]       at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>> [INFO]       at
>> com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
>> [INFO]       at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>> [INFO]       at
>> com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
>> [INFO]       at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>> [INFO]       at
>> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
>> [INFO]       at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>> [INFO]       at
>> com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
>> [INFO]       at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>> [INFO]       at
>> com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.java:366)
>> [INFO]       at
>> com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFilter.java:349)
>> [INFO]       at
>> com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:116)
>> [INFO]       at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
>> [INFO]       at
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
>> [INFO]       at
>> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>> [INFO]       at
>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
>> [INFO]       at
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
>> [INFO]       at
>> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
>> [INFO]       at
>> com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:98)
>> [INFO]       at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>> [INFO]       at
>> com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:491)
>> [INFO]       at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>> [INFO]       at org.mortbay.jetty.Server.handle(Server.java:326)
>> [INFO]       at
>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
>> [INFO]       at
>> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
>> [INFO]       at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
>> [INFO]       at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
>> [INFO]       at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>> [INFO]       at
>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>> [INFO]       at
>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
>>
>> ------------------------------------------------------
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3094175
>>
>
>
> I also have tried downgrading to 2.2.2 and the Error 422 comes back,
> what could the solution for this?
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3094177
>

After quite tries it seems Restlet cannot serialize some parts of the
POJO, is there way to make Restlet log the specific part that can't be
serialized?

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3094180



--
Thierry Boileau, Mr B


6 Rue Rose Dieng-Kuntz • Nantes, 44300  France