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.