Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8619673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:23:48+00:00 2026-06-12T06:23:48+00:00

I am using Restlet version 2.0.15 I am implementing a service that generates a

  • 0

I am using Restlet version 2.0.15

I am implementing a service that generates a potentially large zip file on the fly to be
downloaded by a ReST client. In generating this file, an error may occur, and when it
does I would like to give a meaningful error response to the client.

My setup includes:

In the main, an instance of Application is constructed, and the Component.setStatusS​ervice(StatusService​) and
Application.setStatu​sSevice(StatusServic​e) are invoked with MyStatusService (Extends StatusService)
and, and MyStatusService overrides:

    public Representation getRepresentation(Status status, Request request, Response response) {

    public Status getStatus(Throwable throwable, Request request, Response response) {

    public Status getStatus(Throwable throwable, UniformResource resource) {

…

When I handle the GET request from the client, I set the entity in the response
(Response.setEntity(​Representation) with MyRepresentation which extends OutputRepresentation.
The MyRepresentation class overrides the method:

   public void write(WritableByteChannel writableChannel)

which calls the overridden method:

   public void write(OutputStream outputStream)

which does the work of generating the zip file.

When I run it, the following happens:

ServerCall.sendRespo​nse(Response) calls –>

ServerCall.writeResp​onseBody(Representat​ion, WritableChannel, OutputStream) –> calls

MyRepresentation(extends OutputRepresentation​).write(OutputStream​)

which finds a problem (as expected) with the (intentionally bad for testing reasons) request,
and wants to give the client a meaningful response. So it throws an exception (should it be a ResourceException, or any exception?), which is caught in

ServerAdapter.commit​(HttpResponse) 

but after this point, no call is made to any method in MyStatusService, so the client does not
get a meaningful message, only a 500 status.

Is there a way to control the status (and ideally give an informative message) to the client?

Thanks for any info,

  • Jim
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:23:49+00:00Added an answer on June 12, 2026 at 6:23 am

    This is actually a bug in Restlet. The issue is logged at:

    https://github.com/restlet/restlet-framework-java/issues/670

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently implementing a REST web service using CouchDB and RESTlet. The RESTlet layer
I am using Restlet framework. I create one web service that returns a file
Okay, so I'm designing a stand-alone web service (using RestLET as my framework). My
Using restlet, I want to make a post to android's c2dm service. I have
I am using Restlet FileRepresentation to get a file on the server side of
if im using restlet as an API, can I access it from client PCs
I am running Restful web service on 8182 port using restlet framework. I am
I am having a weird problem with a small restlet service that I am
When I try to compile the sample using sources.zip found at http://www.restlet.org/documentation/1.1/firstSteps Here is
i am using this tutorial to make android as a Rest client . The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.