Koen Maes | 1 Feb 09:54
Picon
Favicon

RE: UriBuilder encoding

in org.restlet.client.data.Reference :

    /**
     * Adds a segment at the end of the path. If the current path doesn't end
     * with a slash character, one is inserted before the new segment value. The
     * value is automatically encoded if necessary.
     * 
     * @param value
     *            The segment value to add.
     * @return The updated reference.
     */
    public Reference addSegment(String value)

K.

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

Avi Flax | 1 Feb 18:05
Favicon

Re: Using MetadataService to specify the default media type

On Thu, Jan 19, 2012 at 05:20, Jerome Louvel <jerome.louvel <at> noelios.com> wrote:
> The proper/standard way in HTTP to do this is to correctly set the
> preferences of your clients (via the “Accept” header typically)… Otherwise,
> the order of the annotated methods declaration might be taken into account
> by Restlet when deciding how to dispatch the method call, but I wouldn’t say
> it is a safe bet to solely rely on this default behavior.
>
> You could customize the ConnegService attached to your parent application to
> force the variant when client preferences are not explicitly given
> (MediaType.ALL), or plug a custom filter in the routing chain to enforce
> your policy.

Jerome,

I’m using 2.0, and I need a way to set the default variant of my
resources. I’m frustrated because I’d think this’d be a common need
and it really should be easier and clearer how to do this. I need to
support requests which don’t include an Accept header, and I need to
be able to set the default variant concisely on a resource-by-resource
basis — not in a centralized Service or Filter.

With the resource I’m working on now, I first tried to just use a
single annotation:

@Get(“html|xhtml”)
public Representation getRep(Variant variant) { … }

I assumed that when a request didn’t include an Accept header, the
conneg algorithm would take into account the order specified and use
html as the default. Unfortunately it does not — for some reason,
(Continue reading)

Jeremy M | 1 Feb 18:48
Picon

OData Extension Socket Timeout Setting

I'm looking for a way to set the socketTimeout parameter when using the OData extension.  I tried setting the
parameter through the Client object obtained through the ClientResource:

        Client client = (Client) cr.getNext();
        client.setContext(new Context());
        client.getContext().getParameters().add("socketTimeout", "1");

by overriding org.restlet.ext.odata.Service.createResource(), but it seems the Service constructor
has already created the Client instance in the constructor so this parameter has no effect.

I've also tried setting and modifying the current Context before even creating the Service instance:

        Context.setCurrent(new Context());
        Context.getCurrent().getParameters().add("socketTimeout", "1");

but that's not working either

Is there a way to do this without having to modify the org.restlet.ext.odata.Service constructor where I
guess I would pass an appropriate Context object at the time of instantiation?

Thanks,

Jeremy

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

Tomasz Kaczynski | 1 Feb 21:49

RE: gwt compiler can

Hmm, 
the error was generated from my misguided attempt to use the FormDtaSet class in the client. The GWT
compiler properly reported error and the .html package didn't provide to be inherited in GWT because it
was meant for Server. The code in question runs on Server just fine. 

--tomekka

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

gaoyong | 2 Feb 04:21
Favicon

about org.restlet.data.request

org.restlet.data.request
in which realease version ???
Thomas Mortagne | 2 Feb 11:05
Picon

RE: UriBuilder encoding

From what I understood this method is supposed to add a new segment and not
replace the {somevar}.

--
View this message in context: http://restlet-discuss.1400322.n2.nabble.com/UriBuilder-encoding-tp7230131p7246398.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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

Domnic | 2 Feb 17:01
Picon
Favicon

RE: Re: reg TokenBuffer

Hello Thierry and Tim,
thanks you for your support. The example works like a gem. Yes Tim is right, When I include the Jackson 1.5 it
is better. I am not getting this error.
thanks
Domnic

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

Domnic | 2 Feb 17:04
Picon
Favicon

AWS and Freemaker + Restlet

Hi there,
I am trying to use a Freemaker template with a restlet Resource. this runs fine on local host i.e. on a
standalone java. But when I try to export a WAR out of it.I get the following error while deployment.

WARNING: Exception or error caught in server resource
java.lang.AbstractMethodError: org.restlet.engine.converter.ConverterHelper.score(Ljava/lang/Object;Lorg/restlet/representation/Variant;Lorg/restlet/resource/Resource;)F
	at org.restlet.engine.converter.ConverterUtils.getBestHelper(ConverterUtils.java:137)
	at org.restlet.service.ConverterService.toRepresentation(ConverterService.java:229)
	at org.restlet.resource.Resource.toRepresentation(Resource.java:738)
	at org.restlet.resource.ServerResource.doHandle(ServerResource.java:509)
	at org.restlet.resource.ServerResource.get(ServerResource.java:695)
	at org.restlet.resource.ServerResource.head(ServerResource.java:977)
	at org.restlet.resource.ServerResource.doHandle(ServerResource.java:587)
	at org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:637)
	at org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:336)
	at org.restlet.resource.ServerResource.handle(ServerResource.java:899)
	at org.restlet.resource.Finder.handle(Finder.java:243)
	at org.restlet.routing.Filter.doHandle(Filter.java:156)
	at org.restlet.routing.Filter.handle(Filter.java:203)
	at org.restlet.routing.Router.doHandle(Router.java:428)
	at org.restlet.routing.Router.handle(Router.java:645)
	at org.restlet.routing.Filter.doHandle(Filter.java:156)
	at org.restlet.routing.Filter.handle(Filter.java:203)
	at org.restlet.routing.Filter.doHandle(Filter.java:156)
	at org.restlet.routing.Filter.handle(Filter.java:203)
	at org.restlet.routing.Filter.doHandle(Filter.java:156)
	at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:151)
	at org.restlet.routing.Filter.handle(Filter.java:203)
	at org.restlet.routing.Filter.doHandle(Filter.java:156)
	at org.restlet.routing.Filter.handle(Filter.java:203)
	at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:208)
	at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:81)
	at org.restlet.Application.handle(Application.java:378)
	at org.restlet.routing.Filter.doHandle(Filter.java:156)
	at org.restlet.routing.Filter.handle(Filter.java:203)
	at org.restlet.routing.Router.doHandle(Router.java:428)
	at org.restlet.routing.Router.handle(Router.java:645)
	at org.restlet.routing.Filter.doHandle(Filter.java:156)
	at org.restlet.routing.Filter.handle(Filter.java:203)
	at org.restlet.routing.Router.doHandle(Router.java:428)
	at org.restlet.routing.Router.handle(Router.java:645)
	at org.restlet.routing.Filter.doHandle(Filter.java:156)
	at org.restlet.routing.Filter.handle(Filter.java:203)
	at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:208)
	at org.restlet.Component.handle(Component.java:389)
	at org.restlet.Server.handle(Server.java:513)
	at org.restlet.engine.ServerHelper.handle(ServerHelper.java:69)
	at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:149)
	at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1086)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:647)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864)
	at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
	at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665)
	at java.lang.Thread.run(Thread.java:636)

My web.xml looks like

 
	<context-param>
		<param-name>org.restlet.application</param-name>
		<param-value>com.aws.resource.AlertApplication</param-value>
	</context-param>

	<servlet>
		<servlet-name>ServerServlet</servlet-name>
		<servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>	
		<init-param>
             <param-name>org.restlet.clients</param-name>
             <param-value>HTTP CLAP</param-value>
         </init-param>	
	</servlet> 
	<servlet-mapping>
		<servlet-name>ServerServlet</servlet-name>
		<url-pattern>/*</url-pattern>
	</servlet-mapping> 
</web-app>

could some one guide me thru this.. esp. in relation to servlet deployment on tomcat ?
thanks
Domnic

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

Tim Peierls | 2 Feb 17:51
Gravatar

Re: AWS and Freemaker + Restlet

The AbstractMethodError suggests that somehow you're getting a stub ConverterHelper that doesn't implement the abstract score method. Make sure you're using the Restlet J2EE edition and the servlet extension. Make sure the Freemarker extension jar (and the Freemarker jar) are on your servlet's classpath. (Make sure you're using the correct version of Freemarker for the extension, too, but I don't think that's the problem.)

I wrote a blog entry about writing Restlet components that can be run both standalone and as servlets. It's specifically geared to Elastic Beanstalk deployments, and it depends on Guice heavily, but the ideas are applicable in general. 


--tim

On Thu, Feb 2, 2012 at 11:04 AM, Domnic <saviodomnic <at> yahoo.com> wrote:
Hi there,
I am trying to use a Freemaker template with a restlet Resource. this runs fine on local host i.e. on a standalone java. But when I try to export a WAR out of it.I get the following error while deployment.

WARNING: Exception or error caught in server resource
java.lang.AbstractMethodError: org.restlet.engine.converter.ConverterHelper.score(Ljava/lang/Object;Lorg/restlet/representation/Variant;Lorg/restlet/resource/Resource;)F
       at org.restlet.engine.converter.ConverterUtils.getBestHelper(ConverterUtils.java:137)
       at org.restlet.service.ConverterService.toRepresentation(ConverterService.java:229)
       at org.restlet.resource.Resource.toRepresentation(Resource.java:738)
       at org.restlet.resource.ServerResource.doHandle(ServerResource.java:509)
       at org.restlet.resource.ServerResource.get(ServerResource.java:695)
       at org.restlet.resource.ServerResource.head(ServerResource.java:977)
       at org.restlet.resource.ServerResource.doHandle(ServerResource.java:587)
       at org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:637)
       at org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:336)
       at org.restlet.resource.ServerResource.handle(ServerResource.java:899)
       at org.restlet.resource.Finder.handle(Finder.java:243)
       at org.restlet.routing.Filter.doHandle(Filter.java:156)
       at org.restlet.routing.Filter.handle(Filter.java:203)
       at org.restlet.routing.Router.doHandle(Router.java:428)
       at org.restlet.routing.Router.handle(Router.java:645)
       at org.restlet.routing.Filter.doHandle(Filter.java:156)
       at org.restlet.routing.Filter.handle(Filter.java:203)
       at org.restlet.routing.Filter.doHandle(Filter.java:156)
       at org.restlet.routing.Filter.handle(Filter.java:203)
       at org.restlet.routing.Filter.doHandle(Filter.java:156)
       at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:151)
       at org.restlet.routing.Filter.handle(Filter.java:203)
       at org.restlet.routing.Filter.doHandle(Filter.java:156)
       at org.restlet.routing.Filter.handle(Filter.java:203)
       at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:208)
       at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:81)
       at org.restlet.Application.handle(Application.java:378)
       at org.restlet.routing.Filter.doHandle(Filter.java:156)
       at org.restlet.routing.Filter.handle(Filter.java:203)
       at org.restlet.routing.Router.doHandle(Router.java:428)
       at org.restlet.routing.Router.handle(Router.java:645)
       at org.restlet.routing.Filter.doHandle(Filter.java:156)
       at org.restlet.routing.Filter.handle(Filter.java:203)
       at org.restlet.routing.Router.doHandle(Router.java:428)
       at org.restlet.routing.Router.handle(Router.java:645)
       at org.restlet.routing.Filter.doHandle(Filter.java:156)
       at org.restlet.routing.Filter.handle(Filter.java:203)
       at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:208)
       at org.restlet.Component.handle(Component.java:389)
       at org.restlet.Server.handle(Server.java:513)
       at org.restlet.engine.ServerHelper.handle(ServerHelper.java:69)
       at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:149)
       at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1086)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:647)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
       at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864)
       at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
       at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665)
       at java.lang.Thread.run(Thread.java:636)


My web.xml looks like


       <context-param>
               <param-name>org.restlet.application</param-name>
               <param-value>com.aws.resource.AlertApplication</param-value>
       </context-param>

       <servlet>
               <servlet-name>ServerServlet</servlet-name>
               <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
               <init-param>
            <param-name>org.restlet.clients</param-name>
            <param-value>HTTP CLAP</param-value>
        </init-param>
       </servlet>
       <servlet-mapping>
               <servlet-name>ServerServlet</servlet-name>
               <url-pattern>/*</url-pattern>
       </servlet-mapping>
</web-app>



could some one guide me thru this.. esp. in relation to servlet deployment on tomcat ?
thanks
Domnic

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

Domnic | 2 Feb 22:58
Picon
Favicon

RE: Re: AWS and Freemaker + Restlet

Hello Tim,
Thanks for your reply. I have to learn Guice and follow up your code.. I will try that ASAP. meanwhile I tried
the manual way... when I export a standalone restlet application into a war..and deploy in aws, it works..
but the moment I try to use the freemaker.. I get the errors. I rechecked the jars...and imported them in the
WEB/lib folder and referenced it in the class path. Now I get a different error..

java.lang.AbstractMethodError
	at org.restlet.engine.converter.ConverterUtils.getBestHelper(ConverterUtils.java:137)
	at org.restlet.service.ConverterService.toRepresentation(ConverterService.java:208)

it is at the converterUtils. do you think it is still the jars.or I am missing something on my web.xml..?

thanks
domnic

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


Gmane