<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.java.restlet">
    <title>gmane.comp.java.restlet</title>
    <link>http://blog.gmane.org/gmane.comp.java.restlet</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/16014"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/16009"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/16008"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/16007"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/16006"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/16005"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/16003"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/16002"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/16001"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/15999"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/15996"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/15994"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/15992"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/15975"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/15974"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/15973"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/15966"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/15953"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/15952"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.restlet/15949"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/16014">
    <title>How to server a video file</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/16014</link>
    <description>&lt;pre&gt;Hi,

I'm using 2.1.2 with the Jetty HTTP connector. I'd appreciate any pointers on the following issue. 

I tried serving a video file to a browser that loads with an &amp;lt;embed src='...'&amp;gt; tag by creating a ServerResource implementing the handle() method and returning a FileRepresentation of my video:

public Representation handle()
{
   return new FileRepresentation(new File(...), MediaType.VIDEO_MP4);
}

that didn't work. It turned out I had to set the representation as the response entity:


public Representation handle()
{
   Representation r =  new FileRepresentation(new File(...), MediaType.VIDEO_MP4);
  response.setEntity(r);
   return r;
}

But the gives my the following exception:

The connection was broken. It was probably closed by the client.

org.eclipse.jetty.io.EofException
at org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:952)
at org.eclipse.jetty.http.AbstractGenerator.blockForOutput(AbstractGenerator.java:518)
at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:182)
at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:101)
at org.restlet.engine.io.BioUtils.copy(BioUtils.java:82)
at org.restlet.representation.FileRepresentation.write(FileRepresentation.java:271)
at org.restlet.engine.adapter.ServerCall.writeResponseBody(ServerCall.java:510)
at org.restlet.engine.adapter.ServerCall.sendResponse(ServerCall.java:454)
at org.restlet.ext.jetty.internal.JettyCall.sendResponse(JettyCall.java:312)


caused by:

Caused by: java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:122)
at sun.nio.ch.IOUtil.write(IOUtil.java:93)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:352)
at org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:305)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:356)
at org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:891)
... 22 more

I trying googling for examples and I couldn't find any documentation about how to create ServerResources and what the rules are for implementation the Representation interface. It's pretty much trial and error and shooting in the dark, so any hint will probably help.

Regards,
Boris

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

&lt;/pre&gt;</description>
    <dc:creator>Borislav Iordanov</dc:creator>
    <dc:date>2013-06-15T07:18:12</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/16009">
    <title>How to tell which client connector library is being used</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/16009</link>
    <description>&lt;pre&gt;Hello,

I am using Restlet as a client (and also as a server, but I am not
having problems with that). I ran into a problem in which Restlet
would start throwing Exceptions after running for a few days --
"too many open files" at first, for a while, then after a while,
UnknownHostException. Dunno what's going on there.

Anyway I tried to replace the default client connector
with the connector based on Apache HttpClient.
From what I can tell, if I put the Apache HttpClient jars
in the classpath, it will be used automatically.
Is that right? How can I tell which client connector is
being used? I don't see any kind of log output which tells
the client connector class.

I've appended the first "too many open files" exception;
many more are thrown after that. I don't see any org.apache
classes in the stack trace -- should I expect to see some
if the Apache HttpClient is in use?

Thanks for any light you can shed on this problem.

Robert Dodier

PS. Here are the jars relevant to Restlet in the classpath:

org.json.jar
org.restlet.ext.json.jar
org.restlet.jar
org.eclipse.jetty.server.jar
org.eclipse.jetty.io.jar
org.eclipse.jetty.continuation.jar
org.eclipse.jetty.http.jar
org.eclipse.jetty.ajp.jar
org.eclipse.jetty.util.jar
org.restlet.ext.jetty.jar
org.apache.httpclient.jar
org.apache.commons.logging.jar
org.apache.commons.codec.jar
javax.servlet.jar

PPS.
Communication Error (1001) - The connector failed to complete the
communication with the server
    at org.restlet.resource.ClientResource.doError(ClientResource.java:612)
    at org.restlet.resource.ClientResource.handleInbound(ClientResource.java:1202)
    at org.restlet.resource.ClientResource.handle(ClientResource.java:1026)
    at org.restlet.resource.ClientResource.post(ClientResource.java:1418)
[snip my code which is kicked off by a timer and calls Restlet]
    at java.util.TimerThread.mainLoop(Timer.java:534)
    at java.util.TimerThread.run(Timer.java:484)
Caused by: java.net.SocketException: Too many open files
    at sun.nio.ch.Net.socket0(Native Method)
    at sun.nio.ch.Net.socket(Net.java:115)
    at sun.nio.ch.SocketChannelImpl.&amp;lt;init&amp;gt;(SocketChannelImpl.java:102)
    at sun.nio.ch.SelectorProviderImpl.openSocketChannel(SelectorProviderImpl.java:55)
    at java.nio.channels.SocketChannel.open(SocketChannel.java:122)
    at org.restlet.engine.connector.ClientConnectionHelper.createSocketChannel(ClientConnectionHelper.java:128)
    at org.restlet.engine.connector.ClientConnectionHelper.getBestConnection(ClientConnectionHelper.java:316)
    at org.restlet.engine.connector.ClientConnectionHelper.doHandleOutbound(ClientConnectionHelper.java:194)
    at org.restlet.engine.connector.BaseHelper.handleOutbound(BaseHelper.java:627)
    at org.restlet.engine.connector.ClientConnectionHelper.handleOutbound(ClientConnectionHelper.java:466)
    at org.restlet.engine.connector.BaseHelper.control(BaseHelper.java:240)
    at org.restlet.engine.connector.Controller.doRun(Controller.java:88)
    at org.restlet.engine.connector.ConnectionController.doRun(ConnectionController.java:162)
    at org.restlet.engine.connector.Controller.run(Controller.java:159)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:679)

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

&lt;/pre&gt;</description>
    <dc:creator>Robert Dodier</dc:creator>
    <dc:date>2013-05-31T22:38:16</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/16008">
    <title>Apache Tiles integration with Restlet.</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/16008</link>
    <description>&lt;pre&gt;I posted this question some time ago on StackOverflow. I didn't get any
answer so far.

I am trying to integrate Apache Tiles &amp;lt;http://tiles.apache.org/&amp;gt; with
Restlet &amp;lt;http://restlet.org/&amp;gt; 2.0+. In addition I want to use freemarker as
a template language within Apache Tiles. I am looking some pointers (blog,
source code etc) showing how Apache Tiles can be integrated with Restlet.

Thanks
Stephane

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&amp;amp;dsMessageId=3056791&lt;/pre&gt;</description>
    <dc:creator>Stephane Fellah</dc:creator>
    <dc:date>2013-05-30T16:13:05</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/16007">
    <title>API Modularization in Restlet</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/16007</link>
    <description>&lt;pre&gt;I have developed a web application based on Restlet API. As I am adding
more features over time, I need sometimes to reuse similar group of REST
API under different endpoints, which provides slightly different context of
execution (like switching different instances of databases with same
schema). I like to refactor my code to make the API reusable and reuse them
at different endpoints. My initial thinking was to design an Application
for each reusable API and attach them on the router:

router.attach("/context1",APIApplication.class)
router.attach("/foo/context2",APIApplication.class)

The API should be agnostic of configuration of the REST API. What is the
best way to pass context information (for example the instance of database)
to the Application API? Is this approach viable and correct? What are the
best practices to reuse REST API in Restlet? Some code samples would be
appreciated to illustrate your answer.

Thanks for your help.


Stephane Fellah

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&amp;amp;dsMessageId=3056643&lt;/pre&gt;</description>
    <dc:creator>Stephane Fellah</dc:creator>
    <dc:date>2013-05-30T15:42:30</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/16006">
    <title>Restlet and Expect: 100-continue</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/16006</link>
    <description>&lt;pre&gt;So it's been almost 3 months. Anyone have insight on the below issue?

It seems that Restlet never sends the response to the 100-continue message.
At one point I thought using Jetty fixed it, but in fact this problem seems
to happen no matter which Connector (default or Jetty) I use.

Any help?

Thanks
Dan

On Mon, Mar 4, 2013 at 7:16 PM, Daniel Halperin
&amp;lt;dhalperi&amp;lt; at &amp;gt;cs.washington.edu&amp;gt;wrote:


------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&amp;amp;dsMessageId=3056491&lt;/pre&gt;</description>
    <dc:creator>Daniel Halperin</dc:creator>
    <dc:date>2013-05-29T02:47:57</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/16005">
    <title>Restlet with Simple connector dropping requests?</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/16005</link>
    <description>&lt;pre&gt;Hi all,

I'm experiencing some really weird behaviour of a restlet server in 
combination with the simple connector. I suspect that Simple is 
discarding specific requests for some unknown reason. Has anyone seen 
such behaviour before? I've posted the details on stackoverflow: 
http://stackoverflow.com/questions/16736359/restlet-with-simple-connector-dropping-requests

Any clues would be highly appreciated.

Regards,
Arjohn Kampman

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

&lt;/pre&gt;</description>
    <dc:creator>Arjohn Kampman</dc:creator>
    <dc:date>2013-05-28T12:22:50</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/16003">
    <title>Problem with delete method in my client application</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/16003</link>
    <description>&lt;pre&gt;Hi all! I'm a newbie with Restlet and I have a problem. I created a service that works perfectly but my client application does not. It fails when I invoke the DELETE method. GET, POST and PUT works fine.

This is the code from my client application:

    JSONObject object = new JSONObject();

    object.put("name", "a name");

    Request request = new Request(Method.DELETE, reference);

    request.setEntity(new JsonRepresentation(object.toString()));

    Client client = new Client(Protocol.HTTP);
    Response response = client.handle(request);
    String text = response.getEntity().getText();

The code from the ServerResource class:

public class MyResource extends ServerResource {

    &amp;lt; at &amp;gt;Delete
    public Representation deleteUser(Representation entity) {
        try {
            String jsonString = (new JsonRepresentation(entity)).getJsonObject().toString();
            Map map = (Map) (new JSONParser()).parse(jsonString);

            if(map.size() &amp;gt; 0) {
                String message = dbc.deleteUser(map.get("name").toString());

                return new StringRepresentation(message, MediaType.TEXT_PLAIN);
            } else {

                return new StringRepresentation("Unable to delete user", MediaType.TEXT_PLAIN);
            }
        } catch (Exception ex) {
            return new StringRepresentation("ERROR: " + ex.getMessage(), MediaType.TEXT_PLAIN);
        }
    }
... }

POST and PUT methods start with the same code. I tested each method using Advanced Rest Client in Chrome and all of them works perfectly. It only fails in my client application. This is the exception:

java.lang.NullPointerException
            at java.io.StringReader.&amp;lt;init&amp;gt;(Unknown Source)
            at org.json.JSONTokener.&amp;lt;init&amp;gt;(JSONTokener.java:66)
            at org.json.JSONObject.&amp;lt;init&amp;gt;(JSONObject.java:402)
            at org.restlet.ext.json.JsonRepresentation.getJsonObject(JsonRepresentation.java:199)
            at service.MyResource.borrarUsuario(MyResource.java:95)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at org.restlet.resource.ServerResource.doHandle(ServerResource.java:503)
            at org.restlet.resource.ServerResource.delete(ServerResource.java:208)
            at org.restlet.resource.ServerResource.doHandle(ServerResource.java:594)
            at org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:649)
            at org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:348)
            at org.restlet.resource.ServerResource.handle(ServerResource.java:952)
            at org.restlet.resource.Finder.handle(Finder.java:246)
            at org.restlet.routing.Filter.doHandle(Filter.java:159)
            at org.restlet.routing.Filter.handle(Filter.java:206)
            at org.restlet.routing.Router.doHandle(Router.java:431)
            at org.restlet.routing.Router.handle(Router.java:648)
            at org.restlet.routing.Filter.doHandle(Filter.java:159)
            at org.restlet.routing.Filter.handle(Filter.java:206)
            at org.restlet.routing.Filter.doHandle(Filter.java:159)
            at org.restlet.routing.Filter.handle(Filter.java:206)
            at org.restlet.routing.Filter.doHandle(Filter.java:159)
            at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:155)
            at org.restlet.routing.Filter.handle(Filter.java:206)
            at org.restlet.routing.Filter.doHandle(Filter.java:159)
            at org.restlet.routing.Filter.handle(Filter.java:206)
            at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:211)
            at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:84)
            at org.restlet.Application.handle(Application.java:381)
            at org.restlet.routing.Filter.doHandle(Filter.java:159)
            at org.restlet.routing.Filter.handle(Filter.java:206)
            at org.restlet.routing.Router.doHandle(Router.java:431)
            at org.restlet.routing.Router.handle(Router.java:648)
            at org.restlet.routing.Filter.doHandle(Filter.java:159)
            at org.restlet.routing.Filter.handle(Filter.java:206)
            at org.restlet.routing.Router.doHandle(Router.java:431)
            at org.restlet.routing.Router.handle(Router.java:648)
            at org.restlet.routing.Filter.doHandle(Filter.java:159)
            at org.restlet.routing.Filter.handle(Filter.java:206)
            at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:211)
            at org.restlet.Component.handle(Component.java:392)
            at org.restlet.Server.handle(Server.java:516)
            at org.restlet.engine.ServerHelper.handle(ServerHelper.java:72)
            at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:152)
            at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1089)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
            at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
            at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009)
            at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
            at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at java.lang.Thread.run(Unknown Source)
    may 22, 2013 3:10:58 PM org.restlet.engine.log.LogFilter afterHandle
    INFO: 2013-05-22    15:10:58    127.0.0.1   -   127.0.0.1   8181    DELETE  /Restlet_Service/   -   200 11  17  20592 http://localhost:8181 Restlet-Framework/2.1.2 -

The line 95 is "String jsonString = (new JsonRepresentation(entity)).getJsonObject().toString();".

I'm stuck and need help with this.
Thanks in advance.

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

&lt;/pre&gt;</description>
    <dc:creator>Sergio</dc:creator>
    <dc:date>2013-05-23T10:30:12</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/16002">
    <title>Possible bug in AuthorizationBaseServerResource</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/16002</link>
    <description>&lt;pre&gt;I have noticed that in some usecases that the function getAuthSession() in AuthorizationBaseServerResource returns null because the cookie has not been set yet. Althought it is set before a redirect in the Attributes of the request. Wouldn't it be more logical to change the getAuthSession() method to:

    protected AuthSession getAuthSession() {
        // Get some basic information
    String sessionId = (String) getRequest().getAttributes().get(
                ClientCookieID);
    
    if (sessionId == null)
            sessionId = getCookies().getFirstValue(ClientCookieID);
    
        getLogger().fine("sessionId = " + sessionId);

        getRequest().getAttributes();
        
        AuthSession session = (sessionId == null) ? null
                : (AuthSession) getContext().getAttributes().get(sessionId);
        return session;
    }

So first verifying the the sessionId is in the request and only then checking if it is in the cookie?

I see that they did this in 2.1 version of restlet, but now they only get it from the cookie?

The bug I'm experiencing does not pop up anymore after I change the restlet oauth extension

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&amp;amp;dsMessageId=3056197&lt;/pre&gt;</description>
    <dc:creator>Andie Similon</dc:creator>
    <dc:date>2013-05-22T15:34:46</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/16001">
    <title>HTTP_DIGEST authorization in android client</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/16001</link>
    <description>&lt;pre&gt;Hey All,

Got following problem with HTTP_DIGEST authorization via Restlet framework on Android.

05-20 18:39:14.623: W/System.err(4584): Challenge scheme HTTP_DIGEST not supported by the Restlet engine. 

05-20 18:39:17.498: W/System.err(4584): Couldn't find any helper support the HTTP_Digest challenge scheme.


Part code that is executed on client and gives above error

clientResource =new ClientResource("http://example.com/position");
try{
clientResource.wrap(MailResource.class);
ChallengeResponse challengeResponse = new ChallengeResponse(ChallengeScheme.HTTP_DIGEST,
"1671046999",
"tiger");      
clientResource.setChallengeResponse(challengeResponse);
clientResource.get();
}
catch (Exception e)
{
e.printStackTrace();
}

Checked that resource via browser and authorization seems to be fine.

Any advices?:)

Google doesn't brought up anything except solution
"I was still missing the DigestHelper. But I found a post about Engine.setUserClassLoader which fixed that
(I'm running in an eclipse plugin/OSGI environment)."
which I don't fully understand.

Cheers!

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

&lt;/pre&gt;</description>
    <dc:creator>Mateusz Zakład</dc:creator>
    <dc:date>2013-05-21T00:07:44</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/15999">
    <title>Cannot find a copy of sample MyNtlmHttpClientHelper.java</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/15999</link>
    <description>&lt;pre&gt;Document:
http://restlet.org/learn/guide/2.0/core/security/authentication/ntml


References a sample NTLM Client Helper for usage with the Apache HTTPClient.  

Does anyone have a copy of the MyNtlmHttpClientHelper.java file that this article references?   Every link I can find appears to point directly back to the main wiki/tutorial pages.

from: http://restlet.org/learn/guide/2.0#/363-restlet/version/default/part/AttachmentData/data/MyNtlmHttpClientHelper.java

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

&lt;/pre&gt;</description>
    <dc:creator>Travis Ferguson</dc:creator>
    <dc:date>2013-05-16T05:09:07</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/15996">
    <title>endless "Too many open files" exceptions</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/15996</link>
    <description>&lt;pre&gt;Hi,

I am working with Restlet 2.1.2, using both client and server
code as parts of a larger applications.

After working correctly for some time (maybe days),
a GET request causes an endless succession of
"Too many open files" exceptions. As it happens,
those are being written into a log file (by nohup) and
eventually exhaust all available disk space -- it appears
the exceptions just keep pouring out, one after another.
Maybe the failed connection is retried immediately, so that
fails again with the same error? Just guessing. I looked at
the source code but I can't tell what's going on.

Here is one such exception. The message is printed by
ServerConnectionController.onSelected.

  Unexpected error while accepting new connection

  java.io.IOException: Too many open files
at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:163)
at org.restlet.engine.connector.ServerConnectionController.onSelected(ServerConnectionController.java:103)
at org.restlet.engine.connector.ConnectionController.selectKeys(ConnectionController.java:308)
at org.restlet.engine.connector.ConnectionController.doRun(ConnectionController.java:171)
at org.restlet.engine.connector.Controller.run(Controller.java:159)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)

(Yes, maybe I could rework the logging configuration so
that it would only fill up a certain amount and then rotate
the log file. That doesn't address the underlying problem.)

It might (or might not) be the case that the error occurs
after a long time in which there are no requests -- i.e.
that it happens on the first request after a long pause.
Not sure about that.

Has anyone seen such a problem? Yes, it would really
help if I could narrow down the problem in time &amp;amp; space.
Yes, I certainly want to do that, and I have not yet
succeeded at it.

Host OS is RedHat Enterprise Linux 6.
java -version says:

  java version "1.6.0_24"
  OpenJDK Runtime Environment (IcedTea6 1.11.3) (rhel-1.48.1.11.3.el6_2-x86_64)
  OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

Thanks for any light you can shed on this problem.

Robert Dodier

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

&lt;/pre&gt;</description>
    <dc:creator>Robert Dodier</dc:creator>
    <dc:date>2013-05-13T22:20:19</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/15994">
    <title>latest on push technology</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/15994</link>
    <description>&lt;pre&gt;Hi,

What is the current recommended strategy with restlet to implement some 
form of a server side push in a browser environment.

In our case we have 2 use cases for this.

1) A standard publish/subscribe requirement for sending messages to the 
client.
2) We need to simulate a server side ssh or telnet terminal session via 
the browser.

For 2 I think it might be better and simpler to use restlet's current 
streaming representation support.

BTW, really enjoying working with the restlet api.

Thanks
Pieter

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

&lt;/pre&gt;</description>
    <dc:creator>Pieter Martin</dc:creator>
    <dc:date>2013-05-11T08:05:40</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/15992">
    <title>Assistance with persisting objects</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/15992</link>
    <description>&lt;pre&gt;I have asked two questions on StackOverflow and was just awarded the "Tumbleweeds" badge because of the low view count and no answers.  I have also searched the web multiple times and don't see anything that answers these questions.

Could someone on this list please take a look at these and let me know how application and request persistence works in Restlet?

http://tinyurl.com/bmhoxvm

http://tinyurl.com/d2xkw8k

Thanks!

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

&lt;/pre&gt;</description>
    <dc:creator>Graham Hunter</dc:creator>
    <dc:date>2013-05-09T04:02:36</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/15975">
    <title>How much REST should your web API get?</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/15975</link>
    <description>&lt;pre&gt;Hi all,

This is slightly off-topic but here is my new blog post, walking you from
hypermedia APIs to cross-device web sites and introducing a formal "Web
API" architecture style:
http://blog.restlet.com/2013/05/02/how-much-rest-should-your-web-api-get/

Please share your thoughts and help us spread the word, this will help
Restlet Framework!

Best regards,
Jerome

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&amp;amp;dsMessageId=3054817&lt;/pre&gt;</description>
    <dc:creator>Jerome Louvel</dc:creator>
    <dc:date>2013-05-02T21:12:17</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/15974">
    <title>Android client - Restlet 2.0.15 - cannot connect with HTTPS/SSL - recoverable error 1001</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/15974</link>
    <description>&lt;pre&gt;Hi all,

I have written an Android web service client using the Restlet framework for
Android (2.0.15), and I've also written the web service backend as well
(again with Restlet 2.0.15 JEE) which has been uploaded on AWS Elastic
Beanstalk (so the client calls would be in the form of
"http://my_web_service.elasticbeanstalk.com/this/is/my/request"). Everything
works fine on HTTP, so now I'd like to replace it with HTTPS, but this has
proven more difficult that I initially thought.

I have created a trial SSL certificate from Comodo, where I have declared,
as a CNAME, a domain that I own (unfortunately, I cannot declare the
elasticbeanstalk.com subdomain, where the AWS load balancer is running, as a
certificate hostname). This certificate has been uploaded to my AWS
instance, and it seems to be running succsefully (tested via web browser, a
couple of https calls get through succesfully after I accept the certificate
on the browser). The only thing that I don't like about this certificate is
the fact that I get a warning that this may be an invalid certificate, since
the declared hostname (my domain) and the actual hostname that the
certificate is running (elasticbeanstalk.com) do not match.

In my client I'm using the apache http client (have loaded the
org.apache.httpclient.jar on claspath), and this is how I create the client
resource I use on every call, which is plain and simple:

/ClientResource resource = new ClientResource(resourceUri);
Engine.getInstance().getRegisteredClients().clear();
Engine.getInstance().getRegisteredClients().add(new
HttpClientHelper(null));/

Of course, /resourceUri/ is in the form of
"https://my_web_service.elasticbeanstalk.com/this/is/my/request", and this
is the only difference between the working HTTP case and the non-working
HTTPS case. With HTTPS, I get the error below:

A recoverable error was detected (1001), attempting again in 2000 ms.

I've tried several suggestions that I found on google (using
org.restlet.ext.net httpclient instead of apache or even loading the
org.restlet.ext.ssl jar from Restlet Android 2.1), but nothing has worked so
far. I've even captured a network trace with Wireshark, and here's the
callflow:

ssl_call_flow.txt
&amp;lt;http://restlet-discuss.1400322.n2.nabble.com/file/n7578771/ssl_call_flow.txt&amp;gt;  

From the callflow above, it seems that client and server fail to complete a
succesful negotiation, but I have no idea why.

Any suggestions on how to resolve this problem are welcome. I believe that
the issue exists on the client side (Android app using Restlet 2.0.15
framework), but not on the app code itself (since everything works fine when
using HTTP) but rather on the SSL negotiation/handshake before actually
making any calls. I also believe that the Certificate Authority (Comodo) is
successfully accepted/trusted by Android (I've done https calls through the
android device browser), but it still gives you a certificate warning that
you need to accept before continuing. Could it be that Restlet 2.0.15 is not
handling smoothly SSL communication, and I would need to upgrade to 2.1 or
later?

Looking forward to hearing your suggestions. In case you'd like to get some
more info that could help, just ask me. :)

Thanks in advance, 
Alex




--
View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Android-client-Restlet-2-0-15-cannot-connect-with-HTTPS-SSL-recoverable-error-1001-tp7578771.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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

&lt;/pre&gt;</description>
    <dc:creator>Alex</dc:creator>
    <dc:date>2013-05-02T18:28:58</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/15973">
    <title>Restlet streaming API for json/xml</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/15973</link>
    <description>&lt;pre&gt;It is very useful that Restlet automatically does content negotiation and 
returns json or xml result by combining annotated interfaces and the 
converter service. Optionally it uses Jackson and xstream for these two 
formats.

The default works fine if the size of the returned results is not very big. 
However, if we returns a huge array of millions of integers in json 
format, it seems a streaming API is more appropriate.

Is it possible to configure Restlet (or Jackson/xstream) at server side so 
it can return json/xml results using a streaming API?

The real application is actually trying to pull out a huge list of integers 
and save them in a file. The list of integers is computed dynamically at 
server side.

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

&lt;/pre&gt;</description>
    <dc:creator>Alice Wong</dc:creator>
    <dc:date>2013-05-01T15:15:47</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/15966">
    <title>catching JSON parse errors</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/15966</link>
    <description>&lt;pre&gt;Hi,

I have a resource that takes a POST request with JSON payload. Let's say it
takes an *int[]*, and for our purposes simply returns it. There are (at
least) two ways to do this:

(1) Accept an *int[]*, letting Jackson auto-deserialize it. For echoing,
return the deserialized array.

  &amp;lt; at &amp;gt;POST
  &amp;lt; at &amp;gt;Consumes(MediaType.APPLICATION_JSON)
  &amp;lt; at &amp;gt;Produces(MediaType.APPLICATION_JSON)
  public int[] postObject(final int[] userData) {
    return userData;
  }


(2) This version accepts a *byte[]*, and then internally deserializes it to
the *int[]* object to be returned.

  &amp;lt; at &amp;gt;POST
  &amp;lt; at &amp;gt;Consumes(MediaType.APPLICATION_JSON)
  &amp;lt; at &amp;gt;Produces(MediaType.APPLICATION_JSON)
  public int[] postObject(final byte[] userData) {
    ObjectMapper mapper = new ObjectMapper();
    try {
      return mapper.readValue(userData, int[].class);
    } catch (Exception e) {
      throw new WebApplicationException(Status.BAD_REQUEST);
    }
  }


Suppose that the request is not deserializable to an *int[]*. E.g.,

[1, 2, 'a']

or

[1, 2,

?

In method 1, the deserialization error will result in a *null* argument
passed to the *postObject* function and the user will get a *204 NO CONTENT*
 response.

In method 2, the deserialization error will result in a catchable
exception, and the client will now get a *400 BAD REQUEST* response.

Is there a way to make method 1 result in a 400 error? Is there a handler
function for those types exceptions? It is quite bulky to have to wrap
every single API call like method 2, but the 204 response is just wrong.

Thanks,
Dan

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&amp;amp;dsMessageId=3054619&lt;/pre&gt;</description>
    <dc:creator>Daniel Halperin</dc:creator>
    <dc:date>2013-04-30T05:22:27</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/15953">
    <title>Using Asynch  setOnResponse</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/15953</link>
    <description>&lt;pre&gt;Hi,I am trying to use and understand the asynchronous client callback.  Here is code sections:

-------------
//In the main:
  ClientResource cr = new ClientResource(myurl);
  cr.setOnResponse(new MyUniform());
  //cr.get();
  cr.getOnResponse();
  System.out.println("done with main");


//In the MyUniform class
public void handle(Request request, Response response) {
  try {
     String text = response.getEntity().getText();
     System.out.println(text);
   } catch (Exception e) {
      e.printStackTrace();
   }
}
----------------

I am not quite sure if I should use ClientResource.get or getOnResponse.  It seems like I should use getOnResponse, but that is having no effect.  If I use get(), it works, but not asynchronously, as it prints "done with main" after the response is obtained.  

Any thoughts on how I can set this up?

Thanks,
-Adam

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

&lt;/pre&gt;</description>
    <dc:creator>Adam Mc</dc:creator>
    <dc:date>2013-04-27T04:31:21</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/15952">
    <title>Restlet with WebLogic 10 - long delay on first request</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/15952</link>
    <description>&lt;pre&gt;Hi,

I am using Restlet 2.1.2 with the Servlet extension.  The app works properly on Tomcat, but on WebLogic 10 it behaves strangely.  The very first request hangs for several minutes in ServerServlet.createComponent while it is calling warClient.handle().  It appears to be recursively scanning the war file looking for restlet.xml (which does not exist).  Unfortunately there are many thousands of class files in hundreds of packages.

Here is the relevant part of the stack.

...
WebAppServletContext.getResourcePaths(String) line: 889
ServletWarEntity.&amp;lt;init&amp;gt;(ServletContext, String, MetadataService) line: 99
ServletWarEntity.&amp;lt;init&amp;gt;(ServletContext, String, MetadataService) line: 106
ServletWarEntity.&amp;lt;init&amp;gt;(ServletContext, String, MetadataService) line: 106
ServletWarEntity.&amp;lt;init&amp;gt;(ServletContext, String, MetadataService) line: 106
ServletWarEntity.&amp;lt;init&amp;gt;(ServletContext, String, MetadataService) line: 106
ServletWarEntity.&amp;lt;init&amp;gt;(ServletContext, String, MetadataService) line: 106
ServletWarEntity.&amp;lt;init&amp;gt;(ServletContext, String, MetadataService) line: 106
ServletWarEntity.&amp;lt;init&amp;gt;(ServletContext, String, MetadataService) line: 106
ServletWarEntity.&amp;lt;init&amp;gt;(ServletContext, String, MetadataService) line: 106
ServletWarEntity.getParent() line: 171
ServletWarClientHelper(EntityClientHelper).handleEntityGet(Request, Response, Entity) line: 265
ServletWarClientHelper(EntityClientHelper).handleLocal(Request, Response, String) line: 310
ServletWarClientHelper.handleLocal(Request, Response, String) line: 110
ServletWarClientHelper(LocalClientHelper).handle(Request, Response) line: 131
ServletWarClient.handle(Request, Response) line: 96
ServletWarClient(Restlet).handle(Request) line: 284
SpringServerServlet(ServerServlet).createComponent() line: 420
...


Can this scan be avoided or somehow improved?  Why is this fast under Tomcat?  Can I make it faster by dropping in a restlet.xml somewhere?  If so, what goes in restlet.xml (I can't see any documentation for that)?

Thanks very much,
Sean

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

&lt;/pre&gt;</description>
    <dc:creator>Sean Hogan</dc:creator>
    <dc:date>2013-04-26T12:14:44</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/15949">
    <title>CookieAuthenticator and redirect</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/15949</link>
    <description>&lt;pre&gt;Hi,

I am trying to get the CookieAuthenticator working for our application.

However it goes into a infinite redirect loop on redirecting to the login form.

I can not work out how to get the CookieAuthenticator filter to not intercept the login form's url.

My application's code is as follows

    &amp;lt; at &amp;gt;Override
    public Restlet createInboundRoot() {
        Router router = new Router(getContext());

        CookieAuthenticator authenticator = new CookieAuthenticator(getContext(), "My Realm", /*must be 16 bytes*/"My Server KeyXXX".getBytes());
        authenticator.setLoginFormPath("/cm/rest/login/login.ftl");
        authenticator.setNext(router);

        MapVerifier mapVerifier = new MapVerifier();
        mapVerifier.getLocalSecrets().put("chunkylover53", "pwd".toCharArray());
        authenticator.setVerifier(mapVerifier);

        router.attach("/rest/login/login.ftl", LoginFormServerResource.class, Template.MODE_STARTS_WITH);
        router.attach("/rest/tools/dashboard", DashboardServerResource.class, Template.MODE_STARTS_WITH);

        return authenticator;
    }

Trying to go to access http://localhost:8080/cm/rest/login/login.ftl goes into a redirect loop.

How can I prevent this?
Thanks
Pieter

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

&lt;/pre&gt;</description>
    <dc:creator>Pieter Martin</dc:creator>
    <dc:date>2013-04-24T12:47:45</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.restlet/15943">
    <title>Setiting media type for webm videos</title>
    <link>http://comments.gmane.org/gmane.comp.java.restlet/15943</link>
    <description>&lt;pre&gt;Hi,

I am trying to get HTML5 *.webm videos to play from a restlet server.  I am using the latest stable with Jetty standalone with the FILE protocol on a directory.  Other types of HTML5 videos play fine, but not webm videos, so I suppose it is a meida type problem.

Looking at my old tomcat setup (videos played fine under tomcat), I see the following: 

&amp;lt;mime-mapping&amp;gt;
   &amp;lt;extension&amp;gt;webm&amp;lt;/extension&amp;gt;
   &amp;lt;mime-type&amp;gt;video/webm&amp;lt;/mime-type&amp;gt;
&amp;lt;/mime-mapping&amp;gt;

So, I tried to translate this to restlet with the following code, but it is still not working.  Any ideas?

public synchronized Restlet createInboundRoot() {
   MetadataService ms = new MetadataService();
   ms.addCommonExtensions();
   ms.addExtension("webm", new MediaType("video/webm"));
   ms.setEnabled(true);
   this.setMetadataService(ms);

  Router router = new Router(getContext());
  // route codes here
   return router;
}

Thanks,
-Adam

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

&lt;/pre&gt;</description>
    <dc:creator>Adam Mc</dc:creator>
    <dc:date>2013-04-22T04:03:58</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.java.restlet">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.java.restlet</link>
  </textinput>
</rdf:RDF>
