Skip to content

Failed to query actuator with error: Key contexts is missing in the map #1501

Discussion options

You must be logged in to vote

hello @prateekkarmakar , we had a look at your sample project that you have shared. Here is what we noticed.

  1. The ConractTest class is annotated with @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) . So the port that you receive via @LocalServerPort which populates private int port will be random.
  2. However in the application.yaml the server port is set to 9000 and management server port is set to 9001.

Since you are using the port number obtained through @LocalServerPort annotation to construct the actuator endpoint URL in "http://localhost:"+port+"/actuator/mappings", this URL may be invalid and that is why you are seeing the error.

Can you please either remov…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@prateekkarmakar
Comment options

@harikrishnan83
Comment options

Answer selected by prateekkarmakar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
2 participants