Laurent Rustuel | 12 Sep 18:26 2014

maven dependencies

Hello,
I'm wanted to try the swagger extension, and thus created a maven 
project with dependency to repository http://maven.restlet.org. When 
building with
<dependency>
<groupId>org.restlet.jee</groupId>
<artifactId>org.restlet</artifactId>
<version>2.3-SNAPSHOT</version>
</dependency>
I've the following error :
[ERROR] Failed to execute goal on project ucs-web: Could not resolve 
dependencies [...]
collect dependencies at 
org.restlet.jee:org.restlet.ext.swagger:jar:2.3-SNAPSHOT ->

org.restlet.jee:org.restlet.lib.org.restlet.lib.org.eclipse.e4.core.contexts:jar:${lib-e4-version}: 
Failed to read artifact descriptor for 
org.restlet.jee:org.restlet.lib.org.restlet.lib.org.eclipse.e4.core.contexts:
jar:${lib-e4-version}: Could not transfer artifact

org.restlet.jee:org.restlet.lib.org.restlet.lib.org.eclipse.e4.core.contexts:pom:${lib-e4-version} 
from/to maven-restlet (http://maven.restlet.org): Illegal character in 
path at index 103:

http://maven.restlet.org/org/restlet/jee/org.restlet.lib.org.restlet.lib.org.eclipse.e4.core.contexts/${lib-e4-version}/org.restlet.lib.org.restlet.lib.org.eclipse.e4.core.contexts-${lib-e4-version}.pom 

If I set this version
mvn compile -Dlib-e4-version=0.12.RC1
I then got the following error :

(Continue reading)

hshorter | 9 Sep 17:45 2014

HTTP -> HTTPS redirect

Is there a way to redirect a browser from HTTP to HTTPS?

For example, I enter "localhost:1234/MyApplication" into a browser and I would like it to redirect to "https://localhost:1234/MyApplication".

Thanks.

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

Ziemowit Stolarczyk | 4 Sep 14:06 2014

ClientResource and proxy settings

Hi!

We have following problem.

1. We use org.restlet.resource.ClientResource in our code.
2. We set up http.nonProxyHosts setting but it does not help. Code always tries to use proxy.

Does ClientResource is able to cooperate with nonProxyHosts setting or should we use different approach?

Could You help?

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

Mitu Kumar Debnath | 3 Sep 21:43 2014
Picon

use of DigestVerifier for verifiying user/pass with mysql DB

Hello,
I was working with Restlet framework lately and I am fairly new with this framework. I was trying to use
DigestVerifier in my serverside code but quite not sure how to use this class. I searched the web for the
example of how to use digest verifier to verify digested user/password coming from clientside request
with digested user/pass from mysql database, but didn't get any. Anyone can provide an example of
DeigestVerifier please?

Thanks in advance.

--mitu

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

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


Gmane