Circular error-handler detected at route: {} - breaking out processing Exchange: {} - exception

I am having multiple camel routes written in Java DSL exceptions are handled using OnException.
Below are my requirements.
Fetch token from cache and make http call
If http call fails with invalid token then make a back end call to get new token and then make http call
If http call fails with specific error then needs to handle it properly.
Issue:
If http call fails with invalid token then it is making backend call to fetch the token and then calling http request using exception handling code. Now the http call failed again while calling from OnException with some other error and it is not going to OnException and giving circular error handler message.
Please help me to handle this error. Thankyou
I am using SpringBoot camel starter 3.8.0 and Java 11

Related

Camel exception before reaching route

I have a restlet route as below
from("restlet:/api?restletMethod=GET").log("API Reached");
The problem is from("restlet:/api?restletMethod=GET") throws an exception when I send an invalid url like http://localhost:8080/api?query=%s%n%s.
How to handle this exception? onException is not working as the request is not reaching the route
I believe you should configure endpoint like this.
RestletEndpoint endpoint = context.getEndpoint("restlet:http://localhost:8080/api", RestletEndpoint.class);
endpoint.configureProperties(Collections.singletonMap("bridgeErrorHandler", true));

Failed to fetch swagger with error message: Unexpected end of JSON input

I have a Function app, which i am calling from a logic App. When ever i am adding the Action for function app, My funciton app unable to retrive. Its showing the below error
Failed to fetch swagger with error message: Unexpected end of JSON
input. Ensure you have CORS enabled on the endpoint and are calling a
valid HTTPS endpoint
I have refereed --> Stackoverflow , but its not working.
Any help is really appreciated.
.

AFNetworking 2.0 - AFSecurityPolicy subclass not working

I am trying to perform some SSL certificate checking that isn't done in the default AFSecurityPolicy (even with various flags set).
I have subclassed AFSecurityPolicy and am returning NO from evaluateServerTrust:forDomain: for testing purposes. I have verified that my class is being called.
AFNetworking's NSURLConnectionDelegate is in the class AFURLConnectionOperation. In the delegate callback, after I return NO, it is calling
[[challenge sender] cancelAuthenticationChallenge:challenge];
The HTTP request completes and I am getting the expected data from the server.
I would expect the HTTP request to not be made after the authentication challenge is cancelled.

Intercept Http Endpoint Exception [Mule ESB]

I'am using Mule 3.3.0 CE and I would have a custom behaviour when an exception is thrown in an http outbound endpoint (i.e when I get a Connection Refused Exception or Connection Timeout Exception). Let's assume that I have this scenario: a SOAP Component and a Http Outbound Endpoint that realize together a cxf service client and let's assume that I can't use any exception strategy.
I would write an Interceptor which intercept the http exception (i.e Connection Refused) and in which I can write a custon behaviour (i.e send the message in a queue).
I need of an interceptor that intercept che http exception and no a SOAP Fault (that could be intercepted with a SOAPFaultInterceptor).
How can I realize this model?
Thank you all for any help
I found the solution. I used a custom interceptor ( component) just before the Http component and I extended the AbstractEnvelopeInterceptor that gives to me the possibility to work before, after and during the component is processing the message.
With this perspective, I implemented the last method. This method's sign contains a boolean value that is setted is an exception occurred. In this way I can leverage this method to handle any kind of exceptions that is related to Http Component.

Exception java.lang.StringIndexOutOfBoundsException in REST JSON Grails

I used the plugin "JSON RESTful API for GORM" for Grails and I have the next exception:
Error 500: Internal Server Error
java.lang.StringIndexOutOfBoundsException
Message
String index out of range: -1
Around line 64 of JSONDomainMarshaller.groovy
But this only happens when my class domain has a reference to another class domain, the other simple class domain runs perfect.
I hope you can help.