You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "David Liu (JIRA)" <ji...@apache.org> on 2011/08/05 04:23:27 UTC
[jira] [Created] (CXF-3712) disable exception stack traces in CXF
Rest
disable exception stack traces in CXF Rest
------------------------------------------
Key: CXF-3712
URL: https://issues.apache.org/jira/browse/CXF-3712
Project: CXF
Issue Type: New Feature
Affects Versions: 2.2.10
Reporter: David Liu
Priority: Minor
Hi,
The *faultStackTraceEnabled* flag in Soap Endpoint is very useful. and I am wondering if we can have the same flag in CXF's Restful service endpoint.
PS. I know we can use ExceptionMapper in CXF Restful endpoint, however, a faultStackTraceEnabled flag would be very useful for all developers. thanks.
David
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-3712) disable exception stack traces in CXF
Rest
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13079817#comment-13079817 ]
Sergey Beryozkin commented on CXF-3712:
---------------------------------------
Can you clarify please what you expect from "faultStackTraceEnabled".
By default, in later CXF versions at least (> 2.2.10), the exception, if not caught by ExceptionMapper, will be propagated (will escape) to
the servlet container and thus the whole stacktrace will be returned...
Can you try please some later versions just to confirm ?
> disable exception stack traces in CXF Rest
> ------------------------------------------
>
> Key: CXF-3712
> URL: https://issues.apache.org/jira/browse/CXF-3712
> Project: CXF
> Issue Type: New Feature
> Affects Versions: 2.2.10
> Reporter: David Liu
> Priority: Minor
>
> Hi,
> The *faultStackTraceEnabled* flag in Soap Endpoint is very useful. and I am wondering if we can have the same flag in CXF's Restful service endpoint.
> PS. I know we can use ExceptionMapper in CXF Restful endpoint, however, a faultStackTraceEnabled flag would be very useful for all developers. thanks.
> David
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CXF-3712) disable exception stack traces in CXF
Rest
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sergey Beryozkin updated CXF-3712:
----------------------------------
Component/s: JAX-RS
> disable exception stack traces in CXF Rest
> ------------------------------------------
>
> Key: CXF-3712
> URL: https://issues.apache.org/jira/browse/CXF-3712
> Project: CXF
> Issue Type: New Feature
> Components: JAX-RS
> Affects Versions: 2.2.10
> Reporter: David Liu
> Priority: Minor
>
> Hi,
> The *faultStackTraceEnabled* flag in Soap Endpoint is very useful. and I am wondering if we can have the same flag in CXF's Restful service endpoint.
> PS. I know we can use ExceptionMapper in CXF Restful endpoint, however, a faultStackTraceEnabled flag would be very useful for all developers. thanks.
> David
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-3712) disable exception stack traces in CXF
Rest
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13080946#comment-13080946 ]
Sergey Beryozkin commented on CXF-3712:
---------------------------------------
Can you actually confirm it ? I'm not sure it's related to the stacktrace. If it were then one of JAXRSClientServerBookTest would fail, given that
BookNotFoundException used in that test obviously has a stack trace...
> disable exception stack traces in CXF Rest
> ------------------------------------------
>
> Key: CXF-3712
> URL: https://issues.apache.org/jira/browse/CXF-3712
> Project: CXF
> Issue Type: New Feature
> Components: JAX-RS
> Affects Versions: 2.2.10
> Reporter: David Liu
> Priority: Minor
>
> Hi,
> The *faultStackTraceEnabled* flag in Soap Endpoint is very useful. and I am wondering if we can have the same flag in CXF's Restful service endpoint.
> PS. I know we can use ExceptionMapper in CXF Restful endpoint, however, a faultStackTraceEnabled flag would be very useful for all developers. thanks.
> David
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (CXF-3712) disable exception stack traces in CXF
Rest
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sergey Beryozkin resolved CXF-3712.
-----------------------------------
Resolution: Not A Problem
Hi David - I'm resolving this one for now - please, do open it again if you can confirm that disabling the exception propagation leaks the stacktrace - I think fault detail is to do with the relevant SOAP Fault detail element...
thanks
> disable exception stack traces in CXF Rest
> ------------------------------------------
>
> Key: CXF-3712
> URL: https://issues.apache.org/jira/browse/CXF-3712
> Project: CXF
> Issue Type: New Feature
> Components: JAX-RS
> Affects Versions: 2.2.10
> Reporter: David Liu
> Priority: Minor
>
> Hi,
> The *faultStackTraceEnabled* flag in Soap Endpoint is very useful. and I am wondering if we can have the same flag in CXF's Restful service endpoint.
> PS. I know we can use ExceptionMapper in CXF Restful endpoint, however, a faultStackTraceEnabled flag would be very useful for all developers. thanks.
> David
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-3712) disable exception stack traces in CXF
Rest
Posted by "David Liu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13080412#comment-13080412 ]
David Liu commented on CXF-3712:
--------------------------------
Hi Sergey,
yup, I know in cxf 2.4 can propagate the exception, however, what I want is to only return the exception name and error message, without returning its stackTrace.
In CXF soap serice, we can set faultStackTraceEnabled=false not to return the whole stackTrace to the client, I want the same flag in the CXF RESTful service to only return exception name and message without stack trace. thanks.
David
> disable exception stack traces in CXF Rest
> ------------------------------------------
>
> Key: CXF-3712
> URL: https://issues.apache.org/jira/browse/CXF-3712
> Project: CXF
> Issue Type: New Feature
> Affects Versions: 2.2.10
> Reporter: David Liu
> Priority: Minor
>
> Hi,
> The *faultStackTraceEnabled* flag in Soap Endpoint is very useful. and I am wondering if we can have the same flag in CXF's Restful service endpoint.
> PS. I know we can use ExceptionMapper in CXF Restful endpoint, however, a faultStackTraceEnabled flag would be very useful for all developers. thanks.
> David
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-3712) disable exception stack traces in CXF
Rest
Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13080842#comment-13080842 ]
Sergey Beryozkin commented on CXF-3712:
---------------------------------------
Hi
that is actually already supported from the start, for example the following xml-formatted message is returned in one of JAX-RS tests:
String data = "<ns1:XMLFault xmlns:ns1=\"http://cxf.apache.org/bindings/xformat\">"
+ "<ns1:faultstring xmlns:ns1=\"http://cxf.apache.org/bindings/xformat\">"
+ "org.apache.cxf.systest.jaxrs.BookNotFoundFault: Book Exception</ns1:faultstring>"
+ "</ns1:XMLFault>";
XMLFaultOutInterceptor reports it - one has to set "org.apache.cxf.propagate.exception" property to false.
The name of the property is different, but I think that in context of JAX-RS services it makes sense, given that
JAX-RS spec requires the propagation of uncaught exceptions by default.
I think registering a custom RuntimeException mapper would offer more flexibility, example, XML or JSON based representation
can be easily created...
I think this issue can be closed...
> disable exception stack traces in CXF Rest
> ------------------------------------------
>
> Key: CXF-3712
> URL: https://issues.apache.org/jira/browse/CXF-3712
> Project: CXF
> Issue Type: New Feature
> Components: JAX-RS
> Affects Versions: 2.2.10
> Reporter: David Liu
> Priority: Minor
>
> Hi,
> The *faultStackTraceEnabled* flag in Soap Endpoint is very useful. and I am wondering if we can have the same flag in CXF's Restful service endpoint.
> PS. I know we can use ExceptionMapper in CXF Restful endpoint, however, a faultStackTraceEnabled flag would be very useful for all developers. thanks.
> David
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CXF-3712) disable exception stack traces in CXF
Rest
Posted by "David Liu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CXF-3712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13080940#comment-13080940 ]
David Liu commented on CXF-3712:
--------------------------------
Hi Sergey,
I've checked the XMLFaultOutInterceptor , I think it will print all details of the exception, please see the code below, it will print the exception's stack trace when it has.
So, if we have *faultStackTraceEnabled * like soap endpoint, we can avoid to print out the xmlFault.getDetails(), thanks.
{code}
if (xmlFault.getDetail() != null) {
StaxUtils.writeStartElement(writer, prefix, XMLFault.XML_FAULT_DETAIL, XMLConstants.NS_XML_FORMAT);
StaxUtils.writeNode(DOMUtils.getChild(xmlFault.getDetail(), Node.ELEMENT_NODE),
writer, false);
writer.writeEndElement();
}
{code}
> disable exception stack traces in CXF Rest
> ------------------------------------------
>
> Key: CXF-3712
> URL: https://issues.apache.org/jira/browse/CXF-3712
> Project: CXF
> Issue Type: New Feature
> Components: JAX-RS
> Affects Versions: 2.2.10
> Reporter: David Liu
> Priority: Minor
>
> Hi,
> The *faultStackTraceEnabled* flag in Soap Endpoint is very useful. and I am wondering if we can have the same flag in CXF's Restful service endpoint.
> PS. I know we can use ExceptionMapper in CXF Restful endpoint, however, a faultStackTraceEnabled flag would be very useful for all developers. thanks.
> David
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira