Using TPT library - have problems

I have tried to use tpt library

OptionDialog dlg = new OptionDialog(TPTApplication.getCurrentApplication());

In this line I have NPE. It occurs when I ask TPTApplication.getCurrentApplication()

So there is a line in

static ThreadLocal<TPTApplication> currentApplication = new ThreadLocal<TPTApplication> ();

public static TPTApplication getCurrentApplication () {
        return currentApplication.get ();

When I trace my code currentApplication is null…

By the way our vaadin app is a part of Grails application

So, what I do wrong? And how can I solve the problem?