Hi All,
Given below is the snippet of my jboss-esb.xml. I want to set the response code and a customized user friendly custom message instead of stack trace, when an exception occurs. Can anyone help me with this?
<services> <service category="Index" description="" invmScope="GLOBAL" name="List"> <listeners> <http-gateway name="Index" urlPattern="index/*"> <exception> <mapping class="com.my.MyActionException" status="502"/> </exception> </http-gateway> </listeners> <actions mep="RequestResponse"> <action class="com.my.Test1" name="print"/> </actions> </service> </services>
Given below is my class MyActionException.java:
import org.jboss.soa.esb.actions.ActionProcessingException; public class MyActionException extends ActionProcessingException { public MyActionException(String message) { super(message); } }
In the class Test1.java, I am throwing a MyActionException.
I am getting the error code as 502 and message , but with the complete stack trace. I need to display only the message not the whole stack trace.
Any suggestions would be very helpful. Thanks in advance.
Regards
Prasad B L V