Developing web services with JAX-WS is very quick and versatile, becoming very easy to create a simple web service and quickly adding complexity like more methods, complex data types, validation, custom application faults, etc. In this example, we are using JBOSS EAP 5.0.
This said, sometimes you stumble onto an awkward moment when you need to start digging to fix some issue. In this case, this was not an issue, but a bugging log that started filling our log files.
In our web services, we throw specific application faults, which are defined automatically in the generated WSDLs. The problem is that when an application fault is thrown, the server logs an error, even if it is expected to be thrown to the client. Also, as the client (a JAX-WS client) receives the fault, the JAX-WS framework logs an error, even if the client catches the application fault and manages it. These logs may mask any other relevant issue or some other valuable information reported by the log file.
These are the logs that can be seen in the server/client:
According to https://issues.jboss.org/browse/JBWS-3299, the log created by the server was reported as a bug and was fixed in the next release of JBOSS.
For the second, I couldn’t find any reported issue, but I assumed it is a similar issue as reported for SOAPFaultHelperJAXWS.
After all this analysis, the workaround that did the job for me was a quick patch to the log4j configuration of the JBOSS server:
That’s it! Now the logs will look much cleaner, and these logs won’t mask any other log that may be important.