我正在为 http 服务器使用 apache camel http4。JBoss Fuse Karaf 容器 6.3.0.redhat-310 已捆绑 camel-core 2.17 - (2.17.0.redhat-630310)
我正在尝试使用异常类 org.apache.camel.component.http.HttpOperationFailedException 来捕获 HTTP 响应异常。
但是,由于 Caused by: java.lang.ClassNotFoundException: org.apache.camel.component.http.HttpOperationFailedException 导致关联路由无法启动
我添加为依赖camel-http,没有任何变化,仍然失败。
似乎不再包括这个类了?
Q. 是由以下原因引起的:java.lang.ClassNotFoundException: org.apache.camel.component.http.HttpOperationFailedException 可用于 http4 服务器,或者有谁知道我做错了什么。
<when id="w2">
<ognl>request.headers.TKNDB == true</ognl>
<process id="a3" ref="assetUploadProcessor"/>
<setHeader headerName="CamelHttpUri" id="h1">
<simple>${header.UPLOADURL}</simple>
</setHeader>
<setHeader headerName="CamelHttpMethod" id="h2">
<constant>GET</constant>
</setHeader>
<doTry id="_doTry1">
<to id="http4-1" uri="http4://d1e53858-2903-4c21-86c0-95edc7a5cef2.predix-uaa.run.aws-usw02-pr.ice.predix.io:443/oauth/token?throwExceptionOnFailure=false"/>
<doCatch id="_doCatch1">
<exception>org.apache.camel.component.http.HttpOperationFailedException</exception>
<onWhen>
<simple>${header.HTTP_RESPONSE_CODE} range "400..600"</simple>
</onWhen>
<log id="_log2" loggingLevel="ERROR" message="HTTP FAILURE - HTTP Response Code: ${header.HTTP_RESPONSE_CODE}"/>
</doCatch>
</doTry>
<log id="l1" loggingLevel="INFO" message="JSON Response: ${body}"/>
<process id="jsonmapperassets" ref="jsonMapperAssets"/>
<split id="as1"
YEILDS ...因为 org.apache.camel.component.http.HttpOperationFailedException 引起:java.lang.ClassNotFoundException:org.apache.camel.component.http.HttpOperationFailedException
我也尝试过使用全局异常处理程序
<exception>org.apache.camel.component.http.HttpOperationFailedException</exception>
<continued>true</continued>
</onException>
但是,在这里我得到一个错误异常说继续不能有孩子????
谢谢你!