Hello,

Sorry to have disturb you, my bad !

client = 
ClientBuilder.newBuilder().property("org.apache.cxf.logging.FaultListener", new 
NoOpFaultListener()) as well as
client = 
ClientBuilder.newBuilder().property("org.apache.cxf.logging.FaultListener", new 
MyFaultListener ())

worked.

Best Regards.

-----Original Message-----
From: Andy McCright [mailto:[email protected]]
Sent: mardi 17 octobre 2017 21:44
To: [email protected]
Subject: Re: Hide the stack trace for org.apache.cxf.interceptor.Fault

Hi Francois,

The class cast exceptions make me think that you've got multiple versions of 
CXF in play.  I'm a WebSphere guy, so I can't say for sure how TomEE works out 
of the box, but my guess is that they package CXF in their runtime similar to 
how we package it in WAS Liberty.  Assuming so, are you also packaging CXF with 
your application?  If so, then that could explain the class cast exceptions and 
also why you are not having any luck disabling the logging.  You might have 
better luck if you don't package CXF with your app.

In either case, would it be possible for you to post the full stack traces?  
Both the one that appears in the logs that you are trying to get rid of and the 
ClassCastExceptions?

Thanks,

Andy

On Tue, Oct 17, 2017 at 12:29 PM, COURTAULT Francois < 
[email protected]> wrote:

> Hello,
>
> First of all, we are using cxf 3.1.10 included in TomEE 7.0.3.
>
> For example:
>
> *         we have a REST 2.0  client which send a request to another TomEE
> 7.0.3.
>
> *         If this server is not there, we get the following message:
> WebClient has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Could not send Message.
>                 ....
> Caused by: java.net.UnknownHostException: UnknownHostException
> invoking ....
>
>
> So, in order to not have this big stack trace in our logs, we
> performed several tests:
>
> *         We have written our own class MyFaultListener which implements
> FaultListener
>
> o   Try to register it  client = ClientBuilder.newBuilder().register(new
> MyFaultListener()).build() => it hasn't worked
>
> o   Try client = 
> ClientBuilder.newBuilder()..property("org.apache.cxf.logging.FaultListener",
> new MyFaultListener ()) => failed with ClassCastException
>
> o   Try client = 
> ClientBuilder.newBuilder()..property("org.apache.cxf.logging.FaultListener",
> new NoOpFaultListener()) => failed with
> org.apache.cxf.logging.NoOpFaultListener
> cannot be cast to org.apache.cxf.logging.FaultListener
>
> *         We have also tried client = 
> ClientBuilder.newBuilder().property("printStackTrace",
> false) => always the stack trace
>
> So what can we do at configuration level or at code level to avoid
> such big stacktrace in our logs ?
>
> Best Regards.
> ________________________________
> This message and any attachments are intended solely for the
> addressees and may contain confidential information. Any unauthorized
> use or disclosure, either whole or partial, is prohibited.
> E-mails are susceptible to alteration. Our company shall not be liable
> for the message if altered, changed or falsified. If you are not the
> intended recipient of this message, please delete it and notify the sender.
> Although all reasonable efforts have been made to keep this
> transmission free from viruses, the sender will not be liable for
> damages caused by a transmitted virus.
>
________________________________
 This message and any attachments are intended solely for the addressees and 
may contain confidential information. Any unauthorized use or disclosure, 
either whole or partial, is prohibited.
E-mails are susceptible to alteration. Our company shall not be liable for the 
message if altered, changed or falsified. If you are not the intended recipient 
of this message, please delete it and notify the sender.
Although all reasonable efforts have been made to keep this transmission free 
from viruses, the sender will not be liable for damages caused by a transmitted 
virus.

Reply via email to