Unable to add license from MCS UI console due to NullPointerException from Jetty

Document created by hassan on Feb 7, 2016
Version 1Show Document
  • View in full screen mode

Author: Hassan Shaik


Original Publication Date: February 12, 2015



From the MCS console, the user observes failures when trying to add/upload a license and the webserver log file (/opt/mapr/logs/adminuiapp.log) has the below NullPonterException from Jetty webserver:

2013-01-09 10:26:36,674 ERROR org.mortbay.log invoke0 [1949550475@qtp0-30]: /api/license/upload
at org.mortbay.servlet.MultiPartFilter.doFilter(MultiPartFilter.java:271)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:81) at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:129)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)

Root cause:

The Jetty webserver was unable to create a temporary file when the license file was uploaded from the webserver.  In this case the browser is a client to the jetty webserver). The actual problem/exception on why the temporary file was not created was suppressed and instead the user sees a NPE in the log file.


This issue can happen if Jetty could not locate or write to its temporary folder under /tmp (ex : /tmp/Jetty__0_webapp____6mo739/). This temp directory gets created by the Jetty webserver automatically and if it gets deleted or cleaned up by a user/script, this problem is observed.


The users can make use of the maprcli command to add a license instead of using the MCS (please check 'maprcli license add' usage for more details). The problem is also resolved after restarting the webserver service.