cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CXF-5719) NoSuchElementException in ClientFaultConverter when stack trace message contains * or #
Date Fri, 23 May 2014 13:14:02 GMT


ASF GitHub Bot commented on CXF-5719:

GitHub user neyb opened a pull request:

    fix CXF-5719 : fix exception occuring on message containing # or *

    remove wrong tokenizer usage : but a bug is still occurring when, exception message contains
"#*#" still exists (but its not a cxf-core bug).
    sorry for the mess with my first last PR : git mindf*** me when merging.

You can merge this pull request into a Git repository by running:

    $ git pull CXF-5719

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #5
commit 35f5dd662824f4fef3da9615c9f773ec8bebccff
Author: neyb <>
Date:   2014-05-23T13:05:12Z

    fix CXF-5719 : remove wrong tokenizer usage, a bug occurring when
    exception message contains "#*#" still exists (but its not a cxf-core bug)


> NoSuchElementException in ClientFaultConverter when stack trace message contains * or
> ---------------------------------------------------------------------------------------
>                 Key: CXF-5719
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.6.10, 2.7.7, 3.0.0-milestone1
>            Reporter: Saad Benbouzid
>              Labels: exception-handling, exceptions, soapfault, stacktrace
>   Original Estimate: 24h
>  Remaining Estimate: 24h
> Following stack trace shows up whenever there is a # or a * character in one of the 'Caused
By:' clause.
> {code}
> Caused by: java.util.NoSuchElementException
> 	at java.util.StringTokenizer.nextToken(
> 	at org.apache.cxf.interceptor.ClientFaultConverter.parseStackTrackLine(
> 	at org.apache.cxf.interceptor.ClientFaultConverter.getCause(
> 	at org.apache.cxf.interceptor.ClientFaultConverter.setStackTrace(
> 	at org.apache.cxf.interceptor.ClientFaultConverter.handleMessage(
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> 	at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(
> 	at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(
> 	at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
> 	at org.apache.cxf.endpoint.ClientImpl.onMessage(
> {code}
> For example : 
> {code}
> org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter
#1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different
jdbcTypeForNull configuration property. Cause: java.sql.SQLException: Type de colonne non
valide: 1111
> ; uncategorized SQLException for SQL []; SQL state [99999]; error code [17004]; Type
de colonne non valide: 1111; nested exception is java.sql.SQLException: Type de colonne non
valide: 1111
> 	at
> 	at
> 	at
> 	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(
> 	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(
> 	at com.sun.proxy.$Proxy74.selectOne(Unknown Source)
> {code}
> Because it considers the # (sharp) character as a delimiter.
> That means actual CSF stack trace deserialization does not work for any 'Caused By' clause
with a sharp (#) or a star character (#)... which is really unpleasant for customization (see
stack trace Apache MyBatis stack trace example above).
> Please avoid *StringTokenizer* splitting in favor of a  *String.split(...)* or a plain
old iterator. Because *StringTokenizer* considers not only *Message.EXCEPTION_CAUSE_SUFFIX*
as a delimiter, but also each character in it, which are sharp # and star *.
> {quote}
> StringTokenizer is a legacy class that is retained for compatibility reasons although
its use is discouraged in new code. It is recommended that anyone seeking this functionality
use the split method of String or the java.util.regex package instead.
> {quote}
> {color:red}
> *org.apache.cxf.interceptor.ClientFaultConverter._setStackTrace_*
> {color}
> also see CXF-5231

This message was sent by Atlassian JIRA

View raw message