RestApi request results in NullValueException

Whenever a request is made against the engine rest api with an execution id of
an execution that isn’t present anymore, the following exception is thrown.

org.camunda.bpm.engine.exception.NullValueException: execution 27dded1b-c8ff-11e6-9442-024229077023 doesn’t exist: execution is null
at sun.reflect.GeneratedConstructorAccessor69.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

Response code 404 is returned to the client, which is absolutely fine, but I don’t want my log
polluted with this exceptions and I can’t find a point where I could intercept.

The api url called is : /engine-rest/process-instance/27dded1b-c8ff-11e6-9442-024229077023

Thanks for any advice.

Cheers hlux

you are calling process-instance URL with execution id.

that is what the client does, yes

Can anybody give some advice on this?

Hi @hlux,

it looks to me like you would either have to cut into logging https://docs.camunda.org/manual/7.6/user-guide/logging/
or override rest endpoint implementation to swallow those exceptions.

Does that help you?
Askar

I guess this is the code that logs the exception: https://github.com/camunda/camunda-bpm-platform/blob/7.6.0/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/exception/RestExceptionHandler.java#L30

You could change the level of that logger, however note that the same logger is also used for unexpected exceptions. If you want to handle those cases differently, then I think you’ll have to exchange the RestExceptionHandler class to use a dedicated logger that you can control independently.

Cheers,
Thorben

Thanks for your help, that is what is thought (was afraid of).

Feel free to submit a pull request that uses distinct loggers and/or logs stacktraces on different levels depending on the status code.