Cannot publish process with NullPointerException