Question

3
Replies
64
Views
MaartenBPM Member since 2013 10 posts
BPM Company
Posted: 2 years ago
Last activity: 2 years 2 months ago
Closed

NullPointerException in log when Pega REST service gets a HEAD http message

I configured uptimerobot.com to monitor a REST service that we provide from Pega 7.3.1. They send a GET and HEAD http message each 5 minutes to the service URL. I noticed that the HEAD message generates a NullPointerException in the log and I'd like to avoid that.

I know that Service REST rules support only the GET, POST, PUT and DELETE methods. But I did some testing from Postman and found these responses on the HTTP methods:

Methods that return a 501 Not Implemented status code: PATCH, COPY, LINK, UNLINK, PURGE, LOCK, UNLOCK, PROPFIND & VIEW. These messages will not be registered if you enable service monitoring;
Methods that return a 500 Internal Server Error status code: HEAD & OPTIONS. Only a HEAD message will be registered when service monitoring is enabled.

So my conclusion is that HEAD and OPTIONS are implemented but are not customizable.

My main question is: Is it possible to avoid a NullPointerException with a HEAD message?

See the log with some extra debug logs in. The bold line will be generated with regular log level settings.

2018-07-13 09:04:38,964 [p-apr-8080-exec-1368] [ STANDARD] [ ] [ ] ( internal.services.ServiceAPI) DEBUG <RemovedHostFromLogMessage> - Constructing alert for messageId PEGA0011
2018-07-13 09:04:38,964 [p-apr-8080-exec-1368] [ STANDARD] [ ] [ ] ( internal.services.ServiceAPI) DEBUG <RemovedHostFromLogMessage> - Enabling alert for messageId PEGA0011
2018-07-13 09:04:38,964 [p-apr-8080-exec-1368] [ STANDARD] [ ] [ ] ( internal.services.ServiceAPI) INFO <RemovedHostFromLogMessage>|Rest|Abillity|API|customers - Processing service request...
2018-07-13 09:04:38,965 [p-apr-8080-exec-1368] [ STANDARD] [ ] [ ] ( internal.services.ServiceAPI) DEBUG <RemovedHostFromLogMessage>|Rest|Abillity|API|customers - entering postLockCleanup()
2018-07-13 09:04:38,965 [p-apr-8080-exec-1368] [ STANDARD] [ ] [ ] ( internal.services.ServiceAPI) ERROR <RemovedHostFromLogMessage>|Rest|Abillity|API|customers - Rest service [Abillity][API][customers] failed::java.lang.NullPointerException

2018-07-13 09:04:38,965 [p-apr-8080-exec-1368] [ STANDARD] [ ] [ ] ( internal.services.ServiceAPI) DEBUG <RemovedHostFromLogMessage> - leaving postLockCleanup()

Data Integration Cloud Services
Moderation Team has archived post
Share this page LinkedIn