tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felipe Jaekel <fkjae...@gmail.com>
Subject Re: CXF default exception mapper config
Date Wed, 26 Jun 2019 14:31:48 GMT
Thanks for the feedback.

I was able to send the exception message to the client with this tutorial:
http://blog.ignacio.org.mx/posts/jax-rs-exception-handling/

It works even better than the default WebApplicationExceptionMapper as I
don't require additional parsing to get the exception message, but I'm
still curious on how to set the addMessageToResponse property of the
default WebApplicationExceptionMapper without using Spring.

Em seg, 24 de jun de 2019 às 19:08, César Hernández Mendoza <
cesarguate@gmail.com> escreveu:

> I haven't implemented your scenario yet but it seems it's related with the
> configuration on the openejb-jar.xml file [1]:
>
>
> In the openejb-jar.xml put
>
> > <openejb-jar xmlns="openejb.org/openejb-jar/1.1">
> >  <pojo-deployment class-name="jaxrs-application">
> >    <properties>
> >           cxf.jaxrs.providers = namespace.YourCustomExceptionMapper
> >    </properties>
> >  </pojo-deployment>
> > </openejb-jar>
>
>
>
> [1]
>
> https://stackoverflow.com/questions/34234609/how-can-i-enable-my-custom-exceptionmapper-in-tomee
>
>
>
>
>
> El mié., 19 jun. 2019 a las 7:29, Felipe Jaekel (<fkjaekel@gmail.com>)
> escribió:
>
> > Hi,
> >
> > I'm working in a REST service that throws WebApplicationExcepion with
> > custom messages. I need pass the custom exception message to the client,
> > but it is ignored. After some search, I found that
> > the WebApplicationExceptionMapper was the responsible for ignoring the
> > exception message, but it has a parameter addMessageToResponse. Setting
> it
> > to true while debugging on Eclipse works as expected. So my question is
> how
> > do I set this parameter on TomEE config? The CXF documentation shows how
> to
> > do it using Spring, but I'm using pure Java EE.
> >
> >
> >
> https://cxf.apache.org/docs/jax-rs-basics.html#JAX-RSBasics-CustomizingdefaultWebApplicationExceptionmapper
> >
> > Thanks
> >
>
>
> --
> Atentamente:
> César Hernández.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message