Different output in live and local environment. Receiving error

January 5, 2018 442 views
Development Ubuntu

The code seems to behave differently in local environment and differently in a live one. A code that works locally doesnt seem to work on digital ocean server.

This is the code I am using and it works fine in local environment

def date = params.deadline
def dateAgain = date.tokenize('/')
def BD = dateAgain[2] + "-" + dateAgain[0] + "-" + dateAgain[1] + " "+ params.deadLinSubmiteTime +":00"
def deadline = Date.parse("yyyy-MM-dd HH:mm:ss", BD)


And this error is what I get in live environment

Unparseable date: "null-10-01-2018-null 16:51:00". Stacktrace follows:
java.text.ParseException: Unparseable date: "null-10-01-2018-null 16:51:00"
at java.text.DateFormat.parse(
at crm.ContactsController.addTask(ContactsController.groovy:1017)
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$

Using MySQL, Tomcat 7 in Ubuntu 14.04.

Be the first one to answer this question.