RESTful JAX-RS Component Support in HST-2: configuring JAX-RS Extension Providers

68 views
Skip to first unread message

Erik Alphenaar

unread,
Jun 19, 2014, 9:36:56 AM6/19/14
to <hippo-community@googlegroups.com>
Hi all,

I'm trying to set up JAX-RS Extension Providers. I followed the exact same instructions on:
see: 4. How to configure JAX-RS Extension Providers

  • I created and annotated the exceptionMapper<MyException> and make it return a 400, or whatever.
  • I added the @provider annotated exception mapper to customJaxrsRestEntityProviders in the spring context.
But I keep on getting the default 500 internal server exception HTML page, instead of my provider to be executed.

Does anyone have any idea of what step is missing??


Thanks in advance and with best Regards,
Erik Alphenaar

Woonsan Ko

unread,
Jun 19, 2014, 11:58:42 AM6/19/14
to hippo-c...@googlegroups.com
Hi Erik,

I think you hit the same problem as HSTTWO-2992:
- https://issues.onehippo.com/browse/HSTTWO-2992

The current JaxrsRestServiceValve seems to ignore the response code
wrapped in WebApplicationException.

Regards,

Woonsan

On 6/19/14 9:36 AM, Erik Alphenaar wrote:
> Hi all,
>
> I'm trying to set up JAX-RS Extension Providers. I followed the exact
> same instructions on:
> http://www.onehippo.org/library/concepts/rest/restful-jax-rs-component-support-in-hst-2.html
>
> see: 4. How to configure JAX-RS Extension Providers
>
> * I created and annotated the exceptionMapper<MyException> and make it
> return a 400, or whatever.
> * I added the @provider annotated exception mapper to
> customJaxrsRestEntityProviders in the spring context.
>
> But I keep on getting the default 500 internal server exception HTML
> page, instead of my provider to be executed.
>
> Does anyone have any idea of what step is missing??
>
>
> Thanks in advance and with best Regards,
> Erik Alphenaar
>
> --
> Hippo Community Group: The place for all discussions and announcements
> about Hippo CMS (and HST, repository etc. etc.)
>
> To post to this group, send email to hippo-c...@googlegroups.com
> RSS:
> https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
> ---
> You received this message because you are subscribed to the Google
> Groups "Hippo Community" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to hippo-communi...@googlegroups.com
> <mailto:hippo-communi...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/hippo-community.
> For more options, visit https://groups.google.com/d/optout.


--
w....@onehippo.com www.onehippo.com
Boston - 101 Main Street, Cambridge, MA 02142
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466

Sudharshini

unread,
Mar 2, 2015, 12:58:53 PM3/2/15
to hippo-c...@googlegroups.com
Hi,
Is there a solution to this ? I ended up in the same problem.

Thanks,
Sudha

Sudharshini

unread,
Mar 3, 2015, 6:46:06 AM3/3/15
to hippo-c...@googlegroups.com
Hi,
I have defined the custom exception mapper in the jaxrs-resources.xml inside hst-assembly\overrides*
But the exception mapper is not picked up, it still returns a 500 response.

Thanks,
Sudha

Sudharshini

unread,
Mar 3, 2015, 11:47:19 AM3/3/15
to hippo-c...@googlegroups.com
Hi,
I have defined a resource which works fine and returns a successful response. In case of errors, I am trying to return a custom exception with a custom response (including error code, and message). 

I have followed the steps provided in the below url (step 4) - Configure JAX-RS Extension Providers

But, customexception mapper is not picked up. I can see only for WebApplicationException - the default WebApplicationExceptionMapper is used to return response. For all custom exceptions the custom exception mapper is not picked. Am I missing something here ?

Thanks,
Sudha
Reply all
Reply to author
Forward
0 new messages