The HTTP File Upload Smart Service fails to upload files with an ‘Entity may not be null’ error. The following exception stack is seen in the application server log:
INFO [stdout] (Appian Work Item - ##SOME ID## - ProcessExec00 : UnattendedJavaActivityRequest) ConnectorRuntimeException [title=Error calling HTTP File Upload, com.appian.integration.core.exception.ConnectorRuntimeException: Entity may not be null] (Appian Work Item - ##SOME ID## - ProcessExec00 : UnattendedJavaActivityRequest) Caused by: java.lang.IllegalArgumentException: Entity may not be null
The smart service does not see an error code in its output.
This occurs because the response being received by Appian only has a response code but no headers . An HTTP response entity is the entire message received without the response code, including headers and an optional body. As soon as Appian sees that this is null, it will fail to process the response.. The body of the message can be null, however, Appian requires that there be at least standard headers in the response.
The API endpoint needs to return at the minimum standard headers in the response for the smart service to function correctly. If this doesn’t work, the next step would be to perform a Fiddler capture to see exactly what response is being returned. Additionally there are other loggers that can be enabled to get more information, however, they are verbose so proper caution should be exercised. The logger to be enabled is log4j.logger.org.apache.http=DEBUG.
log4j.logger.org.apache.http=DEBUG
This article applies to all versions of Appian.
Last Reviewed: February 2017