After upgraded from JRE 1.7.0_21 to 1.7.0_25-b15 my application started to throw NullPointerException in SwingUtilities.invokeLater(...) when it is run from Java WebStart. S
The problem occurs in the Webstart environment. Before Webstart version of Java 7u25 the AppContext was set on the system thread group. Yet it is set on the main thread group.
If you have a thread based on a thread group where its parent or grandparent is not the main thread group it has no sun.awt.AppContext.
You should create your thread based on the thread group of the security manager if one exists.
Runnable task = ....
ThreadGroup threadGroup = System.getSecurityManager() != null
? System.getSecurityManager().getThreadGroup()
: Thread.currentThread().getThreadGroup();
Thread t = new Thread(threadGroup, task, "my thread", 0);