Reputation: 13
In my Java application, I have kept the server port at: 8090
And the property management.port=9080
Now, in my browser, when I open a random link (http://localhost:9080) on the actuator port, my application throws the following error:
No mapping found for HTTP request with URI [/] in DispatcherServlet with name 'dispatcherServlet' 23/11/2018:18:47:54.350 [http-nio-9080-exec-1] E o.a.c.c.C.[.[.[.[dispatcherServlet] --- Servlet.service() for servlet [dispatcherServlet] threw exception java.lang.IllegalArgumentException: No converter found for return value of type: class java.util.LinkedHashMap
Whereas, when I put management.port=8090
(same as the server port), this error is not thrown when I open a random link.
Is there a way to add a default request handler on the actuator port when it is different from the server port in a spring boot application?
Upvotes: 1
Views: 900
Reputation: 129
In a standalone application, the Actuator HTTP port defaults to the same as the main HTTP port. To make the application listen on a different port, set the external property: management.server.port. To listen on a completely different network address (such as when you have an internal network for management and an external one for user applications), you can also set management.server.address to a valid IP address to which the server is able to bind.
Upvotes: 2