If you ever come across the below exception when running WSO2 Enterprise Integrator 6.4, here is the fix. This error occurs when you have multiple IP addresses from different networks configured in your etc/hosts as below. 10.xxx.x.xxx localhost 192.xxx.x.xxx localhost So simply, removing the unnecessary one and leaving the one of the network that you are currently connected to should resolve this issue. 10.xxx.x.xxx localhost
Exception and error handling is one of the most crucial when it comes to web service. It is also the most important as the correct respond should be given to the service consumer. This is not an easy task. You may have to code a wrapper class for error handling. But with spring boot this has become very easy. This blog post is about how a thrown exception can be handled as the response. METHOD 1: package com . example . project . exceptions ; import org.springframework.http.HttpStatus ; import org.springframework.web.bind.annotation.ResponseStatus ; @ResponseStatus ( value = HttpStatus . NOT_FOUND , reason = "No such Movie" ) public class MovieNotFoundException extends Exception { } The exception class must be annotated with @ResponseStatus. This defines the response to be returned when the exception is thrown. So if the controller is as follows, package com . example . project . controllers ; import com.example.package.models.Movie ; i...