1

When the REST client call to a non existet context in my REST service app, the WebSphere Liberty server sends a custom CONTEXT_ROOT_NOT_FOUND error that I would like to replace with my own custom error message.

I tried with FallbackHandler and ExceptionMapper mechanisms (Microprofile technology) but none of them are capturing the error so I'm unable to replace the response.

Does exist any other mechanism to capture this error before it is sent to the client?

Paco Abato
  • 3,920
  • 4
  • 31
  • 54

1 Answers1

0

What is happening is your application is bound to a context root so requests outside the context root are resolving to a 404 by the server because there is no server there. The simplest solution would be to bind your application to the root context which can be done like this:

<webApplication location="my.app.war" contextRoot="/" />
Alasdair
  • 3,071
  • 15
  • 20