Josef Zapletal | 27 Aug 09:15 2014
Picon

Problem with Restlet 2.2 server on Android

Hello,

I have problem with the Restlet for Android. I downloaded ZIP file (http://restlet.com/download/current#release=stable&edition=android&distribution=zip), extract it and from the "\lib" folder I copy "org.restlet.jar" file to the project "\libs" file. I refreshed the project and run clean up the project. Then I compiled the project and try run server (I used this tutorial: http://restlet.com/learn/tutorial/2.2/, part 3. "Listening to Web browsers") but I get this error message:

No available server connector supports the required protocols: 'HTTP' . Please add the JAR of a matching connector to your classpath. Then, register this connector helper manually.

I tried to google some more information, but nothing work. Also post on the stackoverflow (http://stackoverflow.com/questions/25483312/android-first-run-of-restlet-2-2-server-no-available-server-connector) not help. I´m using Eclipse IDE and Android 4.0+.

What do you recommend? Can you help me?


Robert Barnett | 20 Aug 20:39 2014

lib/org.restlet.ext.ssl.jar missing from 2.2.2 zip

The 2.2.2 documentation states that to enable https one must add lib/org.restlet.ext.ssl.jar to the
class path. (source: http://restlet.com/learn/guide/2.2/core/security/https)  But no such jar
appears in the distribution.  Omitting this jar appears to lead to the runtime exception:

java.lang.ClassNotFoundException: org.restlet.ext.ssl.PkixSslContextFactory

Please advise.

Thanks.

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

bitsofinfo | 20 Aug 16:28 2014
Picon

simple spring example help

Hi,
I am trying to wire up the following in spring. I can get the "topComponent" object from my spring context. I
invoke start() on it, however the SpringRouter I have setup does not seem to be registered? 

No matter what URI I go to at localhost:8090/restlet/20140101 i just get 404's

What am I missing? Any help appreciated, thanks

LOG OUTPUT
Starting the internal [HTTP/1.1] server on port
8090
2014-08-20	10:06:21	0:0:0:0:0:0:0:1%0	-	-	8090	GET	/restlet/20140101	-	404	439	0	4	http://localhost:8090	my
user agent

	<bean id="topComponent" class="org.restlet.ext.spring.SpringComponent">
	    <property name="server">
	        <bean class="org.restlet.ext.spring.SpringServer">
	            <constructor-arg value="http" />
	            <constructor-arg value="8090" />
	        </bean>
	    </property>
	    <property name="defaultTarget" ref="defaultRouter" />
	</bean>
	
	 <bean id="topComponent.context"
class="org.springframework.beans.factory.config.PropertyPathFactoryBean" />
	
	<bean id="defaultRouter" class="org.restlet.ext.spring.SpringRouter">
           <constructor-arg ref="topComponent.context"/>
	    <property name="attachments">
	        <map>
	            <entry key="/restlet" value-ref="rootRouter" />
	        </map>
	    </property>
	</bean>
	
	<bean id="rootRouter" class="org.restlet.ext.spring.SpringRouter">
	    <property name="attachments">
	        <map>
	            <entry key="/{apiVersion}">
	                <ref bean="myResource"/>
	            </entry>
	         </map>
	    </property>
	</bean>
	
	<bean id="myResource" class="my.MyResource" scope="prototype">
	</bean>

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

Alex Harvey | 8 Aug 23:13 2014

Using JUnit with JacksonRepresentation

Hi,

I'd like to be able to write some tests using JUnit to rest server resource classes. I'm encountering a
problem when I try to pass a JacksonRepresentation in. My test class looks something a little like this:

{
        TransactionResource resource = new MyResource();
        MyData data = new MyData(etc);

        Representation entity = new JacksonRepresentation<MyData>(myData);

        entity.setMediaType(MediaType.APPLICATION_JSON);

        Representation response = resource.post(entity);
}

This is all fine as far as I know. But I receive an error in my ServerResource derived class when I try and
deserialize the object using Jackson:

            MyData myData = new JacksonRepresentation<>(entity, MyData.class)
                    .getObject();

com.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-input
 at [Source: UNKNOWN; line: 1, column: 1]
	at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:164)
	at com.fasterxml.jackson.databind.ObjectReader._initForReading(ObjectReader.java:1298)
	at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1199)
	at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:798)
	at org.restlet.ext.jackson.JacksonRepresentation.getObject(JacksonRepresentation.java:309)

Is this the correct approach? Am I doing something wrong in my test case in setting up the call to my resource class?

Thanks

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

Shai Levit | 6 Aug 19:40 2014
Picon

Complexity in understanding

So I am working on a more complex format from the tutorials but running into some odd issues and/or
confusions that I don't quite understand.
To simplify things, I attached my code. There are 3 java files (Main, Tracer and RootRoute).
I am trying to get a better understanding on Router, Directory, Application, Root, Restlet and context.
The code compiles fine, but I get an error:

The filter org.restlet.engine.application.RangeFilter <at> 5c4ef185 was executed without a next Restlet
attached to
it.
2014-08-06	13:37:42	0:0:0:0:0:0:0:1	-	-	8183	GET	/	-	500	486	0	10	http://localhost:8183	Mozilla/5.0
(Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36	-

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3086335
Attachment (MainServer.java): application/octet-stream, 2352 bytes
Attachment (RootRoute.java): application/octet-stream, 695 bytes
Attachment (Tracer.java): application/octet-stream, 658 bytes
Ole Hornischer | 6 Aug 12:41 2014
Picon

CDI Weld Issue on Wildfly 8.1 due to public field

Hey everyone,
I discovered an issue with the deployment of the restlet libraries in a project (XWiki) on the current
Wildfly 8.1

When trying to deploy the application with the bundled libraries I get the following error:

[..]
Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-000075: Normal scoped managed bean
implementation class has a public field:  [EnhancedAnnotatedFieldImpl] public org.restlet.ext.jaxrs.internal.provider.JaxbElementProvider.contextResolver
[..]

A bit of googleing and a peek into the source code showed me, that there is indeed a public field named
contextResolver in the org.restlet.ext.jaxrs.internal.provider.AbstractJaxbProvider (in
version 2.2.2) which is commented to be public for testing purposes. 

Is it possible to change the field to be private and test via a getter Method? Because like this restlets
become unusable on Wildfly, at least on vanilla Wildfly.

Cheers,
Ole

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

Robert Barnett | 6 Aug 06:17 2014

Restlet 2.2.1 only serves from one thread

I had a very strange latency issue pop up today which I have isolated to an apparent issue with 2.2.1.  I can
take the "Hello World" stand alone example from Restlet.com and modify the Resource to be:

package firstSteps;

import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;

public class HelloWorldResource extends ServerResource {

     <at> Get
    public String represent() throws InterruptedException
    {
        System.out.println(Thread.currentThread().getId());
        Thread.sleep(10000);
        return "hello, world";
    }
}

I then take two browsers, Firefox and Chrome, and make a request from each.  Firefox shows Hello World after
10 seconds and Chrome after 20.  Looking at the console I see that both requests were serviced by the same
thread.  I can the take my load generator, jMeter, and send a lot of requests in parallel to Restlet.  Restlet
processes them one at a time and always with the same thread. It is as if the default thread pool size is one.
When I downgrade to 2.1 and run the same tests, the issue goes away with a variety of threads servicing the
requests in parallel.

Please advise.

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

Robert Barnett | 31 Jul 19:56 2014

Restlet.com download broken.

When attempting to download Restlet binaries from
http://restlet.com/download/2.2/restlet-jse-2.2.1.zip the download only makes it to about 10 megs
and then has a network error.

Please advise.

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

Atul Kumar | 23 Jul 18:20 2014
Picon

Delay in data extraction from org.restlet.Response

Dear All,

 

I am facing issue while getting json data from Response and creating JSONobject.

 

Issue : Getting delay to create JSONObject. [Approx. 1-2 min ]

This is the code I am using to create the JOSNObject.

 

Representation rep = response.getEntity();

rep.setCharacterSet(CharacterSet.UTF_8); JsonRepresentation

jsonRep = new JsonRepresentation(rep);

JSONObject jsonObj = jsonRep.getJsonObject();

 

 

Jar Details : 1.6 (org.restlet.jar)

Please help me.

 

Thanks,

Atul Kumar

Important Notice:

Absa is an Authorised Financial Services Provider and Registered Credit Provider, registration number: NCRCP7. This e-mail and any files transmitted with it may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Absa. Any views or opinions presented are solely those of the author and do not necessarily represent those of Absa. This e-mail is subject to terms available at the following link: http://www.absa.co.za/disclaimer. The Disclaimer forms part of the content of this email. If you are unable to access the Disclaimer, send a blank e-mail to disclaimer <at> absa.co.za and we will send you a copy of the Disclaimer. By messaging with Absa you consent to the foregoing. By emailing Absa you consent to the terms herein. This email may relate to or be sent from other members of the Absa Group.

Walker Zhang | 16 Jul 04:11 2014
Picon

restlet gwt i18n problem(for Russian lang)

I'm using restlet-gwt to call web service on server. It works fine for locales like 'en' or 'fr', but the XHR
failed to be sent to server due to error in RequestBuilder when I switched to 'ru'. The headers map is:
{Host=localhost:8080, Date=Пт, 11 июля 2014 01:58:21 UTC,
User-Agent=Restlet-Framework/2.0.14, Accept=application/json} and the value for Date is causing
the following the error:
Caused by: com.google.gwt.http.client.RequestException: (TypeError): Cannot convert string to
ByteString because the character at index 0 has value 1063 which is greater than 255.
    at com.google.gwt.http.client.RequestBuilder.setHeaders(RequestBuilder.java:422)
    at com.google.gwt.http.client.RequestBuilder.doSend(RequestBuilder.java:386)
    at com.google.gwt.http.client.RequestBuilder.send(RequestBuilder.java:237)
    at org.restlet.client.engine.http.GwtClientCall.sendRequest(GwtClientCall.java:254)
    at org.restlet.client.engine.http.adapter.ClientAdapter.commit(ClientAdapter.java:92)
    at org.restlet.client.engine.http.HttpClientHelper.handle(HttpClientHelper.java:110)
    at org.restlet.client.Client.handle(Client.java:168)
    at org.restlet.client.resource.ClientResource.handle(ClientResource.java:697)

I'm using GWT 2.2 and Restlet-gwt 2.1.7
Please any help will be highly appreciated!

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3085230
17:35:52.016 [ERROR] [welcomeportal] Uncaught exception escaped

org.restlet.client.resource.ResourceException: Internal Connector Error
    at org.restlet.client.resource.ClientResource.handle(ClientResource.java:623)
    at org.restlet.client.resource.ClientResource.handle(ClientResource.java:645)
    at org.restlet.client.resource.ClientResource.handle(ClientResource.java:593)
    at org.restlet.client.resource.ClientResource.get(ClientResource.java:418)
    at org.talend.mdm.webapp.base.client.rest.ClientResourceWrapper.request(ClientResourceWrapper.java:113)
    at org.talend.mdm.webapp.welcomeportal.client.rest.StatisticsRestServiceHandler.getRoutingEventStats(StatisticsRestServiceHandler.java:154)
    at org.talend.mdm.webapp.welcomeportal.client.widget.RoutingChart.initChart(RoutingChart.java:69)
    at org.talend.mdm.webapp.welcomeportal.client.widget.RoutingChart.&lt;init&gt;(RoutingChart.java:52)
    at org.talend.mdm.webapp.welcomeportal.client.MainFramePanel.initializePortlet(MainFramePanel.java:335)
    at org.talend.mdm.webapp.welcomeportal.client.MainFramePanel.initializePortlets(MainFramePanel.java:282)
    at org.talend.mdm.webapp.welcomeportal.client.MainFramePanel.initializePortlets(MainFramePanel.java:191)
    at org.talend.mdm.webapp.welcomeportal.client.MainFramePanel.access$10(MainFramePanel.java:179)
    at org.talend.mdm.webapp.welcomeportal.client.MainFramePanel$3.onSuccess(MainFramePanel.java:166)
    at org.talend.mdm.webapp.welcomeportal.client.MainFramePanel$3.onSuccess(MainFramePanel.java:1)
    at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:232)
    at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
    at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395)
    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 com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
    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 com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
    at java.lang.Thread.run(Thread.java:662)
Caused by: com.google.gwt.http.client.RequestException: (TypeError): Cannot convert string to
ByteString because the character at index 0 has value 1063 which is greater than 255.
    at com.google.gwt.http.client.RequestBuilder.setHeaders(RequestBuilder.java:422)
    at com.google.gwt.http.client.RequestBuilder.doSend(RequestBuilder.java:386)
    at com.google.gwt.http.client.RequestBuilder.send(RequestBuilder.java:237)
    at org.restlet.client.engine.http.GwtClientCall.sendRequest(GwtClientCall.java:254)
    at org.restlet.client.engine.http.adapter.ClientAdapter.commit(ClientAdapter.java:92)
    at org.restlet.client.engine.http.HttpClientHelper.handle(HttpClientHelper.java:110)
    at org.restlet.client.Client.handle(Client.java:168)
    at org.restlet.client.resource.ClientResource.handle(ClientResource.java:697)
    at org.restlet.client.resource.ClientResource.handle(ClientResource.java:767)
    at org.restlet.client.resource.ClientResource.handle(ClientResource.java:767)
    at org.restlet.client.resource.ClientResource.handle(ClientResource.java:665)
    at org.restlet.client.resource.ClientResource.handle(ClientResource.java:620)
    at org.restlet.client.resource.ClientResource.handle(ClientResource.java:645)
    at org.restlet.client.resource.ClientResource.handle(ClientResource.java:593)
    at org.restlet.client.resource.ClientResource.get(ClientResource.java:418)
    at org.talend.mdm.webapp.base.client.rest.ClientResourceWrapper.request(ClientResourceWrapper.java:113)
    at org.talend.mdm.webapp.welcomeportal.client.rest.StatisticsRestServiceHandler.getRoutingEventStats(StatisticsRestServiceHandler.java:154)
    at org.talend.mdm.webapp.welcomeportal.client.widget.RoutingChart.initChart(RoutingChart.java:69)
    at org.talend.mdm.webapp.welcomeportal.client.widget.RoutingChart.&lt;init&gt;(RoutingChart.java:52)
    at org.talend.mdm.webapp.welcomeportal.client.MainFramePanel.initializePortlet(MainFramePanel.java:335)
    at org.talend.mdm.webapp.welcomeportal.client.MainFramePanel.initializePortlets(MainFramePanel.java:282)
    at org.talend.mdm.webapp.welcomeportal.client.MainFramePanel.initializePortlets(MainFramePanel.java:191)
    at org.talend.mdm.webapp.welcomeportal.client.MainFramePanel.access$10(MainFramePanel.java:179)
    at org.talend.mdm.webapp.welcomeportal.client.MainFramePanel$3.onSuccess(MainFramePanel.java:166)
    at org.talend.mdm.webapp.welcomeportal.client.MainFramePanel$3.onSuccess(MainFramePanel.java:1)
    at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:232)
    at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
    at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395)
    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 com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
    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 com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
    at java.lang.Thread.run(Thread.java:662)

Jerome Louvel | 15 Jul 21:15 2014

API World competition support

Hi all,

Our APISpark platform (based on Restlet Framework) is in 2nd position, not far from 1st, in the API Infrastructure category for the "API World" awards competition.

The winners will get great exposure (see this previous visual landscape from DevNetwork that put Restlet in a nice spot close to cool developer technologies) and free tickets to the event based in San Francisco.

I would really appreciate your support to get a boost to first place! The voting ends in less than 12 hours. If we win, all remaining extra tickets will be given out to interested supporters.


Gmane