cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "hwavelet (JIRA)" <j...@apache.org>
Subject [jira] Created: (CXF-1597) setStackTrace method of org.apache.cxf.interceptor.ClientFaultConverter make me can't put stackTrace elment under fault detail element
Date Tue, 20 May 2008 09:02:55 GMT
setStackTrace method of org.apache.cxf.interceptor.ClientFaultConverter make me can't put stackTrace
elment under fault detail element
--------------------------------------------------------------------------------------------------------------------------------------

                 Key: CXF-1597
                 URL: https://issues.apache.org/jira/browse/CXF-1597
             Project: CXF
          Issue Type: Improvement
          Components: Core
    Affects Versions: 2.1.1
            Reporter: hwavelet
             Fix For: 2.1.1


i think method setStackTrace may need have a change like this to make it more compatible with
other databinding:

 private void setStackTrace(Fault fault, Message msg) {
        Map<String, String> ns = new HashMap<String, String>();
        XPathUtils xu = new XPathUtils(ns);
        String ss = (String) xu.getValue("/" + Fault.STACKTRACE + "/text()", fault.getDetail(),
//changed
                XPathConstants.STRING);
        List<StackTraceElement> stackTraceList = new ArrayList<StackTraceElement>();
        if (!StringUtils.isEmpty(ss)) {
            StringTokenizer st = new StringTokenizer(ss, "\n");
            while (st.hasMoreTokens()) {
                String oneLine = st.nextToken();
                StringTokenizer stInner = new StringTokenizer(oneLine, "!");
                if(stInner.countTokens() == 4) {
                  StackTraceElement ste = new StackTraceElement(stInner.nextToken(), stInner.nextToken(),
                          stInner.nextToken(), Integer.parseInt(stInner.nextToken()));
                  stackTraceList.add(ste);
              } else {
                  break;
              }
            }
            if (stackTraceList.size() > 0) {
                StackTraceElement[] stackTraceElement = new StackTraceElement[stackTraceList.size()];
                Exception e = msg.getContent(Exception.class);
                e.setStackTrace(stackTraceList.toArray(stackTraceElement));
            }
        }

    }

if changed like so, we can put arbitrary stackTrace element under fault detail instead of
the specified xml format

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message