falcon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Srikanth Sundarrajan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FALCON-211) REST API returns html when there is an exception instead of requested media type
Date Tue, 04 Nov 2014 06:55:40 GMT

    [ https://issues.apache.org/jira/browse/FALCON-211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14195809#comment-14195809
] 

Srikanth Sundarrajan commented on FALCON-211:
---------------------------------------------

There is an implicit and incorrect assumption both within the FalconClient and HttpChannel
code that Entity object returned in response to a call to a REST API would be of type APIResult
(or its sub class). We ought to do the following with this.

1. Customize the error-page in web.xml to provide formatted non-html content
2. Inspect the response status family and fall back to String Entity when response status
isn't informational or successful.

> REST API returns html when there is an exception instead of requested media type
> --------------------------------------------------------------------------------
>
>                 Key: FALCON-211
>                 URL: https://issues.apache.org/jira/browse/FALCON-211
>             Project: Falcon
>          Issue Type: Bug
>            Reporter: Venkatesh Seetharam
>            Assignee: Jean-Baptiste Onofré
>
> bin/falcon entity -type process -suspend -name ingest-process
> {code}
> Nov 19, 2013 11:53:15 AM com.sun.jersey.api.client.ClientResponse getEntity
> SEVERE: A message body reader for Java class org.apache.falcon.resource.APIResult, and
Java type class org.apache.falcon.resource.APIResult, and MIME media type text/html; charset=iso-8859-1
was not found
> Nov 19, 2013 11:53:15 AM com.sun.jersey.api.client.ClientResponse getEntity
> SEVERE: The registered message body readers compatible with the MIME media type are:
> */* ->
>   com.sun.jersey.core.impl.provider.entity.FormProvider
>   com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General
>   com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$General
>   com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$General
>   com.sun.jersey.core.impl.provider.entity.StringProvider
>   com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
>   com.sun.jersey.core.impl.provider.entity.FileProvider
>   com.sun.jersey.core.impl.provider.entity.InputStreamProvider
>   com.sun.jersey.core.impl.provider.entity.DataSourceProvider
>   com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
>   com.sun.jersey.core.impl.provider.entity.ReaderProvider
>   com.sun.jersey.core.impl.provider.entity.DocumentProvider
>   com.sun.jersey.core.impl.provider.entity.SourceProvider$StreamSourceReader
>   com.sun.jersey.core.impl.provider.entity.SourceProvider$SAXSourceReader
>   com.sun.jersey.core.impl.provider.entity.SourceProvider$DOMSourceReader
>   com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
>   com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
>   com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
>   com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
>   com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$General
>   com.sun.jersey.core.impl.provider.entity.EntityHolderReader
> Nov 19, 2013 11:53:15 AM com.sun.jersey.api.client.ClientResponse getEntity
> SEVERE: A message body reader for Java class org.apache.falcon.resource.InstancesResult,
and Java type class org.apache.falcon.resource.InstancesResult, and MIME media type text/html;
charset=iso-8859-1 was not found
> Nov 19, 2013 11:53:15 AM com.sun.jersey.api.client.ClientResponse getEntity
> SEVERE: The registered message body readers compatible with the MIME media type are:
> */* ->
>   com.sun.jersey.core.impl.provider.entity.FormProvider
>   com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General
>   com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$General
>   com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$General
>   com.sun.jersey.core.impl.provider.entity.StringProvider
>   com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
>   com.sun.jersey.core.impl.provider.entity.FileProvider
>   com.sun.jersey.core.impl.provider.entity.InputStreamProvider
>   com.sun.jersey.core.impl.provider.entity.DataSourceProvider
>   com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
>   com.sun.jersey.core.impl.provider.entity.ReaderProvider
>   com.sun.jersey.core.impl.provider.entity.DocumentProvider
>   com.sun.jersey.core.impl.provider.entity.SourceProvider$StreamSourceReader
>   com.sun.jersey.core.impl.provider.entity.SourceProvider$SAXSourceReader
>   com.sun.jersey.core.impl.provider.entity.SourceProvider$DOMSourceReader
>   com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
>   com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
>   com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
>   com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
>   com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$General
>   com.sun.jersey.core.impl.provider.entity.EntityHolderReader
> Error: <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
> <title>Error 400 Remote user header can't be superusers:[oozie, mapred, falcon,
hdfs]</title>
> </head>
> <body><h2>HTTP ERROR 400</h2>
> <p>Problem accessing /api/entities/suspend/process/ingest-process. Reason:
> <pre>    Remote user header can't be superusers:[oozie, mapred, falcon, hdfs]</pre></p><hr
/><i><small>Powered by Jetty://</small></i><br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> </body>
> </html>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message