JAXWS DISABLING EXCEPTION STACK TRACE

This post is just a tip on how to stop displaying those ugly stack trace errors in productions when working with JAXWS implementations.

This would help your end point's exception messages look much more cleaner.

All you need to do is to add this VM argument to your start up script.

 

-Dcom.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace=false

 

The way you start your server might be different depending on what type of servlet container you are using.

We embed tomcat in our child care attendance tracking application and we use our own start up script.

I would just describe how you can add this to tomcat if your application is deployed the normal way which is to have your application within tomcat.

Tomcat uses the catalina.sh or catalina.bat to start up the container depending on your deployment environment.

Tomcat uses a VM argument to enable its logging in this file.

The logging functionality in this file is enabled with the JAVA_OPTS variable.

You can look for the JAVA_OPTS variable in this file to see how you can add a VM argument to tomcat 6. In fact, you can add the VM argument to the JAVA_OPTS variable.

This would work just fine.

I hope this would help someone out there looking to enable this feature in their application.