[ 
https://issues.apache.org/jira/browse/CAMEL-20770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17949577#comment-17949577
 ] 

John Yin commented on CAMEL-20770:
----------------------------------

Hi [~davsclaus] , need some advice from you.  Recently, due to a security 
vulnerability in org.apache.httpcomponents.client5:httpclient5:5.4.2 (an 
indirect dependency of CXF), we manually force it to use version 5.4.4.  We 
left org.apache.httpcomponents.client5:httpcore5-h2 to 5.3.3 (instead of 
upgrading it to 5.3.4).  When we ran our application, everything seemed to work 
fine, no error in the log, no exception.  But after awhile, we noticed that the 
timer route calling CXF stopped doing anything.  It turned out that httpclient5 
needs to call a method in httpcore5-h2, and it uses a new signature of the 
httpcore5-h2 method not in the version 5.3.3 (the method has been changed from 
httpcore5-h2:5.3.3 to 5.3.4).  So, there was a NoSuchMethodError.  But the 
error was not caught by onException, the thread simply dead.  If onException 
had caught this error, we would have discovered the issue much sooner.  Any 
advice on how to handle this in Camel would be greatly appreciated.

Thanks,

John

> onException(Throwable.class) does not catch java.lang.AssertionError
> --------------------------------------------------------------------
>
>                 Key: CAMEL-20770
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20770
>             Project: Camel
>          Issue Type: Bug
>          Components: came-core
>    Affects Versions: 4.4.0
>            Reporter: John Yin
>            Priority: Major
>
> The onException(Throwable.class) does not catch java.lang.AssertionError in 
> 4.4.0.  It worked fine in 3.18.x.
> Here is a sample:
> {code:java}
> from("timer://test?repeatCount=1")
>     .onException(Throwable.class).handled(true).log("in onException").end()
>     .process({
>         assert false : "test onException for assert"
>     }) {code}
> The onException would not catch the assert failure and not print "in 
> onException" in log.  The onException can catch other exceptions.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to