Uncaught NullPointer Exception in Karaf console from com.entwinemedia.fn.data.json.SimpleSerializer.toJson

Steps to reproduce

Steps to reproduce:
1. Opencast was running for 5 hours with 7 Videos being processed.
2. Without a know issue NullPointer Exception showed up in the Karaf console.
3. This error does not show up in the logs. And there is no ERROR in the logs that might relate to this NPE

Actual Results:

Expected Results:

Workaround (if any):


Christoph Driessen
March 7, 2016, 9:44 PM

It's not a bug in the library but somewhere in the lib's client code. Since the whole library is made for functional programming it completely abandons the use of null values. A decision has been made to not check for null values everywhere in the lib but the move that responsibility to the client for two reasons. First, the keep the lib's code concise by leaving out all those ugly assertions. Second, to encourage clients to not work with nulls as legal values at all costs. Use the Opt type instead. However, using the lib together with legacy Opencast code that embraces nulls may lead to NPEs. However, there is a convenience function to create JSON values from unknown types that safely deals with nulls. I have to go through the whole code base and see where it has not been used though it needs to.

Fixed and reviewed


Christoph Driessen


Rüdiger Rolf


Incorrectly Functioning With Workaround

Tags (folksonomy)



Fix versions

Affects versions