KB-1645 NullPointerException when using Post System Event to Feed Smart Service

Symptoms

The Post System Event to Feed Smart Service fails, generating a system alert. In the app server log, the following error is printed:

HH:MM:SS INFO [stdout] (ajp-/0.0.0.0:8009-18) YYYY-MM-DD HH:MM:SS [ajp-/0.0.0.0:8009-18] ERROR com.appiancorp.process.engine.UnattendedJavaActivityRequest - An error occurred while executing activity: id=268456448, classname=com.appiancorp.process.runtime.activities.PostSystemEventToFeedSmartService4 
HH:MM:SS INFO [stdout] (ajp-/0.0.0.0:8009-18) com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.eventNotSent.userMsg=Internal error. The system event was not sent.] alertMsg[error.eventNotSent.alertMsg=Internal error (java.lang.NullPointerException). The system event was not sent.]
...
HH:MM:SS INFO [stdout] (ajp-/0.0.0.0:8009-18) Caused by: java.lang.NullPointerException
HH:MM:SS INFO [stdout] (ajp-/0.0.0.0:8009-18) at com.appiancorp.security.user.User.<init>(User.java:49)
HH:MM:SS INFO [stdout] (ajp-/0.0.0.0:8009-18) at com.appiancorp.security.audit.AuditInfo.initForCreate(AuditInfo.java:62)
HH:MM:SS INFO [stdout] (ajp-/0.0.0.0:8009-18) at com.appiancorp.tempo.rdbms.RdbmsFeedSourceImpl.bindEntryDataFromKToRdbms(RdbmsFeedSourceImpl.java:1499)
HH:MM:SS INFO [stdout] (ajp-/0.0.0.0:8009-18) at com.appiancorp.tempo.rdbms.RdbmsFeedSourceImpl.addEntry(RdbmsFeedSourceImpl.java:546)
HH:MM:SS INFO [stdout] (ajp-/0.0.0.0:8009-18) at com.appiancorp.process.runtime.activities.FeedHelper.postToFeed(FeedHelper.java:63)

Cause

The username of the user designated to run this smart service is different in the primary database and the Appian engines. This difference causes a NullPointerException when attempting to invoke the smart service.

Action

Compare the corresponding username in the primary database with the username that is referenced by the Appian engines. The username referenced by the engines can be observed in the User section of the administrator console. The username in the primary database can obtained with a SQL query against the usr table.

If these are different, update the component that has the incorrect username such that both usernames are the same. If you require assistance with this or any step, reach out to Appian Technical Support for assistance.

Affected Versions

This article applies to all versions of Appian.

Last Reviewed: August 2018

Related
Recommended