Hi, You can get the Factory using this code:
Endpoint e = server.getEndpoint(); ProviderFactory factory = (ProviderFactory)e.get(ProviderFactory.class.getName()); Unfortunately factory hasn't getter for the exceptionMappers, as workaround you can access the property using reflection API. I would consider to add public getter for the providers into ProviderFactory/ServiceProviderFactory. Regards, Andrei. > -----Original Message----- > From: Jason Wang [mailto:[email protected]] > Sent: Mittwoch, 8. Januar 2014 03:25 > To: [email protected] > Subject: How to turn off stack trace for WebApplicationExceptionMapper in > CXF RS 2.7.8? > > Hi all, > > I noticed that for exceptions such as BadRequestException, the > WebApplicationExceptionMapper nicely translate it into reponse but also > logs the entire track with warn level. > > I think that Mapper is automatically added as a provider (I am using jaxrs > 2.7.8 and Oauth 2 module). > > I can see that the exception mapper actually has a flag called > printStackTrace. > > But it seems the mapper got added by the ProviderFactory as the default. > > So my question is, how do I get a reference to that mapper and call the setter > to mute the stack trace? > > Cheers, > Jason
