Katalon Studio and Groovy Script - java.lang.nullpointerexception with Timer and TimerTask

I am getting the “java.lang.nullpointerexception” with katalon studio version 7.1.2, while scheduling a task with Timer and TimerTask classes I need to perform some task for every 5 minutes and till 30 minutes.

In MacOS, tried with Katalon version 7.1.1 and 7.1.2, the below code working perfectly But in Windows OS, with same Katalon versions, Im getting this exception

Here is my code snippet,

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint

import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase

import static com.kms.katalon.core.testdata.TestDataFactory.findTestData

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject

import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint

import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile

import com.kms.katalon.core.model.FailureHandling as FailureHandling

import com.kms.katalon.core.testcase.TestCase as TestCase

import com.kms.katalon.core.testdata.TestData as TestData

import com.kms.katalon.core.testobject.TestObject as TestObject

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows

import internal.GlobalVariable as GlobalVariable

import static java.util.concurrent.TimeUnit.*;

import java.util.concurrent.Executors;

import java.util.Timer;

import java.util.TimerTask;

import java.util.*

import java.time.*

Timer timer = new Timer();

Date currentTime = new Date();

def maxDuration

use (groovy.time.TimeCategory) {

maxDuration = 30.minutes.from.now


timer.schedule(new TimerTask() {


public void run() {

currentTime = new Date()

if(currentTime.compareTo(maxDuration) < 0) {

//Some Task







}, 0, 5601000);

Hi @suma.betigiri

Please post the full console log containing the error message. Null pointer exceptions can be thrown from a lot of places.