restlet

TaskQueue failing to do HTTP call - Missing mandatory headers?

可紊 提交于 2020-01-04 04:43:04
问题 Error is in this code: public String getVersion() { String result = null; int index = this.getRequest().getProtocol().indexOf(47); if (index != -1) { result = this.getRequest().getProtocol().substring(index + 1); } return result; } Error is "Couldn't find the mandatory "Host" HTTP header.": 10:34:29,889 INFO [org.restlet] (Thread-6 (HornetQ-client-global-threads-1773619305)) Couldn't find the mandatory "Host" HTTP header. 10:34:29,910 WARNING [org.restlet.Component.Server] (Thread-6 (HornetQ

GAE/GWT: Error loading modules: Unable to find 'com/androidstartup/serialization/KPadProject.gwt.xml'

让人想犯罪 __ 提交于 2020-01-03 13:37:35
问题 I am using Eclipse 3.5 with GAE SDK 1.3.7 and GWT SDK 2.1.0 and Restlet 2.0.3. When I run my app, the console log shows: Loading modules com.androidstartup.serialization.KPadProject [ERROR] Unable to find 'com/androidstartup/serialization/KPadProject.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source? [ERROR] shell failed in doSlowStartup method The main module /KPadProject.gwt.xml is in the root package. I checked out the configuration

Restlet, An example of a get with parameters

一曲冷凌霜 提交于 2020-01-02 21:59:10
问题 Just startred using restlet with java and was pleasently surprised how easy it was. However this was with puts. I then started to work with get but couldn't work out how to pass infromation with the get. With the put it was easy as: @Put public Boolean store(Contact contact); But when i try and do this with get it doesnt work. From reading around i think i have to not pass it any parameters and just have this: @Get public Contact retrieve(); and then pass the parameters in a url or something?

Upload a file using Restlet multipart/form-data in java

ぃ、小莉子 提交于 2020-01-02 09:58:50
问题 So I searched quite a bit now for sample codes but the only thing I found was on examples for the server side, meaning the receiving part . I want to create an application, that uses restlet to upload a file, content type: multipart/form-data . So I need the sending part How do I create the form for this? What I tried is the following, but it's not working: public void UploadFile(File f){ Form fileForm = new Form(); fileForm.add(Disposition.NAME_FILENAME, "test.jpg"); Disposition disposition

Restlet can't get the data with Android

 ̄綄美尐妖づ 提交于 2020-01-01 19:19:10
问题 I'm going to get data with Restlet of this official OData page: http://services.odata.org/OData/OData.svc/ I've started this tutorial : http://weblogs.asp.net/uruit/archive/2011/09/13/accessing-odata-from-android-using-restlet.aspx My problem is, that at the end, he can't get the metadata . But first: When I'm trying to generate the Restleg-Files (Point 5), the console is showing this, where the lines with are date are red : --------------------------- OData client code generator ------------

Restlet - trouble attaching Resource class with Router

*爱你&永不变心* 提交于 2019-12-31 01:49:09
问题 Prototyping with Restlet 2.1.0, Java SE version, I am having trouble mapping ServerResource classes to urls. I've tried quite a few variations using the Router.attach method, but nothing has worked. My current code looks like this: /** * @param args * @throws Exception */ public static void main(String[] args) throws Exception { final Router router = new Router(); router.attach("/hello", FirstServerResource.class); router.attach("/json", Json.class); Application myApp = new Application() {

Restlet createQuery fails with connection error (and after workaround NoSuchMethodError)

喜你入骨 提交于 2019-12-25 08:02:02
问题 I followed the Android restlet tutorial and tried to consume a sample OData webservice (http://services.odata.org/OData/OData.svc/). When I create a query with myService.createProductQuery("/Products"); logcat tells me that ERROR/org.restlet(700): Can't get the metadata for ... A problem similar to this question. I did try and register the Apache client as suggested by Jerome Louvel: Engine.getInstance().getRegisteredClients().clear(); Engine.getInstance().getRegisteredClients().add(new

Restlet - Jax-RS 2.0 aware?

匆匆过客 提交于 2019-12-25 05:22:44
问题 I saw that Restlet already has a stable 2.0 Version and even further testing and unstable 2.1 and 2.2 version. Are they already JAX-RS 2.0 aware? If its true, they seem to be further in the JAX-RS implementation than the jersey jax-rs reference framework. 回答1: Restlet Framework (RF) versions are not synced at all with JAX-RS versions. Currently RF 2.1 only supports JAX-RS 1.0. Note however that we have added (non standard) JAX-RS client-side support in RF 2.1 via the org.restlet.ext.jaxrs

Using Restlet ClientResource cannot send entity to Restlet Service

♀尐吖头ヾ 提交于 2019-12-25 04:26:34
问题 I'm having problem with Restlet client call to a working rest service: final ClientResource resource = new ClientResource(Routes.PUBLIC_STORE_API); resource.setOnResponse(new Uniform() { public void handle(Request request, Response response) { try { Status status = response.getStatus(); if(!Status.isError(status.getCode())){ String jsonResponse = response.getEntity().getText(); } else { // Handle error } } catch (Exception e){ callback.failure(new Throwable(e.getMessage())); } } });

422 Unprocessable Entity on Restlet ClientProxy and GAE Server

浪尽此生 提交于 2019-12-25 01:47:03
问题 I have a Front-end application on a separate domain that is communicating with the Restlet backend on a different domain. So far, CORS work properly and the only issue is the bean serialization. As I check the request it has this Accept type: application/x-java-serialized-object+gwt However for some reason I don't know when the backend runs on localhost my GWT app works fine in sending/receiving data to/from the backend (at localhost), but when the backend is deployed in GAE cloud (i.e.