This is an internal documentation. There is a good chance you’re looking for something else. See Disclaimer.

Nice2 Runtime Errors

Business Unit Requested not Found (DWR call)


__System.checkHeartbeat.dwr … PermanentPersistException: Expected 1 items but list size is 0!


This happens when the browser requests a business unit (via X-Business-Unit HTTP request header) but that unit doesn’t or does no longer exist. You’ll see this frequently when you start a different customer on localhost without logging out first.


Logout and then in again (in all browsers including private browsing windows).

Full Error

2017-10-20 14:31:17.433 WARN  org.eclipse.jetty.servlet.ServletHandler [qtp1259602878-119]
ch.tocco.nice2.persist.PermanentPersistException: Expected 1 items but list size is 0!
    at ch.tocco.nice2.businessunit.impl.BusinessUnitManagerImpl.getBusinessUnitById( ~[na:na]
    at $ch.tocco.nice2.businessunit.impl.BusinessUnitManagerImpl_15f39c09bac.getBusinessUnitById( ~[na:na]
    at $BusinessUnitManager_15f39c097a7.getBusinessUnitById($ ~[na:na]
    at ch.tocco.nice2.businessunit.impl.SetBusinessUnitFilter.getBusinessUnit( ~[na:na]
    at ch.tocco.nice2.businessunit.impl.SetBusinessUnitFilter.doFilter( ~[na:na]
    at $ch.tocco.nice2.businessunit.impl.SetBusinessUnitFilter_15f39c09bef.doFilter( ~[na:na]

Wkhtmltopdf Out-of-Memory


RuntimeException: wkhtmltopdf exited with code 139: Error running wkhtmltopdf

Wkhtmltopdf <0.12.4 shows this error:

java.lang.RuntimeException: Error running wkhtmltopdf


The wkhtmltopdf process has been killed by signal 9 (SIGKILL) 1. This most likely happened because of an out-of-memory error.


Option 1: Reduce Memory Usage

  • Try to reduce memory usage by …
    • … splitting the report (i.e. select fewer entities at once).

    • … reducing the size of the report resources (e.g. smaller image resolution, no custom font).

    • … simplifying the report (e.g. remove headers/footers, different corporate design).

    • … limiting the number of reports generated concurrently.

Option 2: Increase Available Memory

Increase requested memory to ensure the instance is moved onto a node with enough free memory available and/or adjust the memory limit to ensure it’s not hit when generating reports. 2

Full Error:

2017-10-21 01:10:51.683 ERROR nice2.netui.ExceptionHandler [qtp1709207019-7217] user_pk=2996, error_id=7fgDoz, user_name=pgerber, session=117821, clientip=, request_id=803683
An exception occurred on the server.
java.lang.RuntimeException: wkhtmltopdf exited with code 139: Error running wkhtmltopdf: ERROR:
        at ch.tocco.wkhtmltopdf.binary.WkHtmlToPdfBinary.handleError(
        at ch.tocco.nice2.conversion.impl.phantomjs.WkHtmlToPdfConverter.convert(
        at ch.tocco.nice2.conversion.impl.phantomjs.WkHtmlToPdfConverter.convert(
        at $ch.tocco.nice2.conversion.impl.phantomjs.WkHtmlToPdfConverter_15f29845c57.convert(
        at $ConverterEngine_15f29845c4a.convert($
        at ch.tocco.nice2.reporting.impl.freemarker.utils.PdfConverterServiceImpl.convertToPdf(
        at $ch.tocco.nice2.reporting.impl.freemarker.utils.PdfConverterServiceImpl_15f29845c54.convertToPdf(
        at $PdfConverterService_15f29845c44.convertToPdf($
        at ch.tocco.nice2.reporting.impl.freemarker.handlers.WkHtmlToPdfHandler.handleFileFormat(
        at $ch.tocco.nice2.reporting.impl.freemarker.handlers.WkHtmlToPdfHandler_15f29845c53.handleFileFormat(
        at $FileFormatHandler_15f29845c3c.handleFileFormat($
        at ch.tocco.nice2.reporting.impl.freemarker.FreemarkerReportFactory$FreemarkerReportImpl.processOutput(
        at ch.tocco.nice2.reporting.impl.freemarker.FreemarkerReportFactory$FreemarkerReportImpl.export(



Processes that exit due to a signal usually exit with a code of 127 + SIGNAL_NUMBER.


Wkhtmltopdf is a separate process, written in C++ mostly, hence adjusting the Java memory limit won’t affect it.