Intermittent NPE in java.io.reader

2014-04-25 Thread Andy Dennie
Hi, I'm hoping maybe this problem looks familiar to somebody out there.. I'm using Restlet 2.1.4 on GAE, and I'm seeing intermittent NPEs with the (partial) stack trace below. This is happening on about 1% of requests. 17:00:19.465 org.restlet.engine.io.BioUtils getReader: The GAE edition is u

RE: propagating conversion exception reason back to client in response body

2014-01-07 Thread Andy Dennie
Hold on, it looks like there was an update to ConverterService about a year ago that addressed this (by no longer squelching the exception). It's just not in 2.1, which is what I'm using. Any chance it might be backported to 2.1? -- http://r

propagating conversion exception reason back to client in response body

2014-01-07 Thread Andy Dennie
If, during conversion of a request body, my converter's (subclass of ConverterHelper) toObject method identifies some problem with the structure or content of the body, I'd like to be able to return detailed information back to the client in the response body (e.g. "missing field 'foo'"). Howev

RE: GWT Restlet cross domain Put request

2013-12-11 Thread Andy Dennie
When the browser sends the OPTIONS pre-flight request, the server needs to respond with a Access-Control-Allow-Methods header indicating which methods are supported for CORS requests. I'm doing something like this (hopefully the formatting won't get mangled...): Series requestHeaders =

RE: Re: Re: MediaType: should application/xml be compatible with application/*+xml?

2013-11-06 Thread Andy Dennie
I took a closer look today, and it's not the ignoreParameters that's at fault (in fact, it should be considered included regardless of whether ignoreParameters is true or false, since ignoreParameters applies to "this" and not "included", and "this" has no parameters). I think the fix would be

RE: Re: MediaType: should application/xml be compatible with application/*+xml?

2013-11-05 Thread Andy Dennie
4 1/2 years later, I have a follow-up question :-) shouldn't "application/json" include "application/vnd.foo.bar-baz-v1+json; level=3" ? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3067938

RE: Conditional GET doesn't properly handle content negotiation?

2012-04-13 Thread Andy Dennie
Upon further reflection, I've concluded that this isn't necessarily a bug in the converters (they're free to return a positive score for a null target Variant if they want), but rather a bug in ServerResource.doConditionalHandle. If content negotation is in strict mode and getPreferredVariant()

RE: Conditional GET doesn

2012-04-12 Thread Andy Dennie
I forgot to mention one other thing... In converterService.toRepresentation, after getting the ObjectRepresentation back from GwtConverter, there's a null pointer exception in the following code, due to target being null. if (result.getEncodings().isEmpty()) { result.ge

RE: Re: Conditional GET doesn

2012-04-12 Thread Andy Dennie
Thanks, Tim. I'll give your approach a try (replacing those converters with my own). -Andy -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2947791

Conditional GET doesn't properly handle content negotiation?

2012-04-12 Thread Andy Dennie
Here's my use case: I'm submitting a conditional GET (using If-None-Match, although I don't think that's relevant) request that also specifies a media type in the Accept header that doesn't match any of the media types supported by the target resource (i.e. it doesn't correspond to any of the m

Re: combining role and method authorization

2012-03-14 Thread Andy Dennie
Hi Tim, wow, thanks for the detailed response. Let me take this bit by bit to keep things comprehensible. > I use decorator factory methods in my Applications to allow me to > specify filtering compactly for each individual resource path. Doesn't > have to be fancy: > > // AbcServerResource

Re: combining role and method authorization

2012-03-13 Thread Andy Dennie
Oops, I forgot to address the question of authorization based on identity and resource instance state. I'm assuming I'd do that inside the ServerResource itself, right? -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/combining-role-and-method-authorization-tp7366193

Re: combining role and method authorization

2012-03-13 Thread Andy Dennie
As a followup to my previous question, just to make things more interesting, I also would like to mix in authorization based on identity and resource instance state. For example, in addition to the rules I mentioned, an authenticated user may PUT or DELETE a collection item they created, but not c

combining role and method authorization

2012-03-12 Thread Andy Dennie
I have a variety of resources that have specific authorization rules, e.g. collection resources that allow anonymous users to GET, authenticated users to GET or POST (to create a new item), and admins to GET/PUT/POST/DELETE. I'm looking at MethodAuthorizer and RoleAuthorizer, but I'm not sure of

RE: ProGuard on Android interfering with client proxy method invocation

2012-03-02 Thread Andy Dennie
OK, this is what ended up working: -keep class org.restlet.resource.* { *; } -keep class org.restlet.engine.adapter.* { *; } It's likely that the class specification could be narrowed further with additional trial and error, but for me, the returns are diminishing. -

RE: ProGuard on Android interfering with client proxy method invocation

2012-03-01 Thread Andy Dennie
update - I'm zeroing in on the solution, I think. I'll post again when I've got it. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2928561

ProGuard on Android interfering with client proxy method invocation

2012-03-01 Thread Andy Dennie
I just recently started leveraging ProGuard to shrink/obfuscate my Android app that uses Restlet. I've run into a problem at the point where my app invokes a method on a dynamic resource proxy generated by ClientResource.wrap(). Specifically, I'm getting a "java.lang.AbstractMethodError: abstract

Re: how to set ETag response header from ServerResource annotated method?

2012-03-01 Thread Andy Dennie
Hi Tim, Yes, you've surmised my situation correctly. Thanks for the response, that approach is working for me now. -Andy -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/how-to-set-ETag-response-header-from-ServerResource-annotated-method-tp7309680p7333755.html Sen

RE: @Post generic parameter conversion bug/missing feature

2012-02-26 Thread Andy Dennie
Did anybody log an issue for this? I didn't see one, but I don't want to log a dup. -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Post-generic-parameter-conversion-bug-missing-feature-tp7223520p7319344.html Sent from the Restlet Discuss mailing list archive at Nab

how to set ETag response header from ServerResource annotated method?

2012-02-22 Thread Andy Dennie
I'd like to set an ETag response header while processing a request within my ServerResource subclass. I tried getResponseEntity().setTag(new Tag("foo)); but this doesn't work, because there is no entity in the response object yet (getResponseEntity returns null). What's the right way to do t

posting form from GWT to app engine - package mismatch

2012-01-27 Thread Andy Dennie
I'm trying to POST a form from GWT client code to GAE server code. The annotated interface shared by both sides is import org.restlet.client.data.Form; import org.restlet.client.resource.Post; public interface MyResource { @Post("form") void doSomething(Form form); } What's the right w

RE: @Post generic parameter conversion bug/missing feature

2012-01-27 Thread Andy Dennie
I ran into the same issue recently. I was going to try to fix it, but the reflection code was too hairy for me :-) -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2911894

Re: accessing response Status from GWT client code - works in hosted mode but not production

2011-12-13 Thread Andy Dennie
Update: I have logged an issue for this: http://restlet.tigris.org/issues/show_bug.cgi?id=1361 http://restlet.tigris.org/issues/show_bug.cgi?id=1361 -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/accessing-response-Status-from-GWT-client-code-works-in-hosted-mode-b

RE: making outbound HTTP calls from GAE - ConnectorService not wired right?

2011-12-12 Thread Andy Dennie
Problem solved. I was missing the necessary parameters in web.xml. See http://wiki.restlet.org/docs_2.0/13-restlet/275-restlet/312-restlet/379-restlet.html. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2892751

Re: accessing response Status from GWT client code - works in hosted mode but not production

2011-12-12 Thread Andy Dennie
further experiments show that the problem doesn't happen when the request is successful (200). When it's a 302, the problem reproduces. Not sure about other status codes. -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/accessing-response-Status-from-GWT-client-code

Re: accessing response Status from GWT client code - works in hosted mode but not production

2011-12-12 Thread Andy Dennie
FWIW, the same problems occur in production mode regardless of whether deferred binding is used or not. Today I tried this: ClientResource r = new ClientResource("/admin/myresource"); r.setOnResponse(new Uniform() { @Override public void handle(final Request reques

Re: accessing response Status from GWT client code - works in hosted mode but not production

2011-12-11 Thread Andy Dennie
last update for today... I upgrade to 2.1RC1 of the GWT edition of Restlet, but it didn't help. -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/accessing-response-Status-from-GWT-client-code-works-in-hosted-mode-but-not-production-tp7083856p7084566.html Sent from the

Re: accessing response Status from GWT client code - works in hosted mode but not production

2011-12-11 Thread Andy Dennie
Hmm, for a minute there I thought I might be able to get at the response headers. I discovered that I can do this: Series responseHeaders = (Series) myClientResource.getResponse().getAttributes().get( HeaderConstants.ATTRIBUTE_HEADERS); And in hosted mode, it works, but once again, n

Re: accessing response Status from GWT client code - works in hosted mode but not production

2011-12-11 Thread Andy Dennie
OK, after some further debugging in hosted mode, although I don't see the root of my problem in production mode, I do see that ClientAdapter.commit() is doing: // Send the request to the client httpCall.sendRequest(request, response, new Uniform() {

Re: accessing response Status from GWT client code - works in hosted mode but not production

2011-12-11 Thread Andy Dennie
Correction, the reason phrase is null in hosted mode, also -- sorry. So, I tried accessing the response's status description instead, via Status.getDescription(). But it turns out that this is empty in production mode, while non-empty in in hosted mode. So I still have a similar problem. -An

accessing response Status from GWT client code - works in hosted mode but not production

2011-12-11 Thread Andy Dennie
Hi, I'm using Restlet 2.1 M5 in my GWT client and my GAE server code. When I make a request to the server in hosted mode, in my onSuccess() method, I'm able to access the response's status code and reason phrase via ClientResource.getResponse().getStatus(), using Status.getCode() and Status.getR

RE: making outbound HTTP calls from GAE - ConnectorService not wired right?

2011-12-08 Thread Andy Dennie
Minor update, but still stuck. I can see that when org.restlet.ext.net.jar.HttpClientHelper is constructed, it's in the context of org.restlet.engine.Engine's construction. It adds the necessary protocols (HTTP, HTTPS) to the List held by its ConnectorHelper superclass, and the HttpClientHelpe

making outbound HTTP calls from GAE - ConnectorService not wired right?

2011-12-08 Thread Andy Dennie
I have a GAE app and I'm trying to make an outbound HTTP GET request (using the ROME extension). I've added the org.restlet.ext.net.jar file to my classpath as described in sectino 8.5.2 of the Restlet in Action book, but when I make the get() call below: ClientResource resource =

using org.restlet.routing.Template in GWT code

2011-11-11 Thread Andy Dennie
is it possible to use the Template class in GWT code? It's not part of the GWT edition, as far as I can tell. I want to use it to format the URI template of the resource I'm communicating with. -AndyD -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/using-org-restl

Re: 500 error from ServerResource.doHandle, can't figure out why

2011-10-03 Thread Andy Dennie
Still stuck on this. Any advice would be greatly appreciated! -AndyD -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/500-error-from-ServerResource-doHandle-can-t-figure-out-why-tp6840764p6854792.html Sent from the Restlet Discuss mailing list archive at Nabble.com.

500 error from ServerResource.doHandle, can't figure out why

2011-09-28 Thread Andy Dennie
Hi, OK, Restlet newbie here, probably doing something dumb, but I've been stuck for a while now and no amount of googling is helping :-). Pretty simple situation. My restlet client is an android app, server is on GAE. Both sides using 2.1M5. Right now I'm just trying to invoke a test GET me

Re: Sample Serlialization Android client works with 2.0 but not 2.1

2011-07-11 Thread Andy Dennie
Thanks to Jerome, I got this working with 2.1, using a workaround for now: Engine.getInstance().getRegisteredClients().clear(); Engine.getInstance().getRegisteredClients().add(new HttpClientHelper(null)); -- View this message in context: http://restlet-di

Re: Sample Serlialization Android client works with 2.0 but not 2.1

2011-06-27 Thread Andy Dennie
Update... based on some searching on StackOverflow, I found a tip to add the line: Engine.getInstance().getRegisteredConverters().add(new JacksonConverter()); However, this had no effect. -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Sample-Serli

Sample Serlialization Android client works with 2.0 but not 2.1

2011-06-27 Thread Andy Dennie
Hi, I'm having trouble getting the version 2.1 serialization sample Android client working. It works when I use the 2.0.8 version of Restlet for Android, but not when I use the 2.1M5 (or M4) version, regardless of whether I use cr.setRequestEntityBuffering(true) or whether I comment it out (I have