User Task Form Failure: The Context Path is either empty or not defined

I am a new user and using embedded forms in the user tasks. The html files are present in the servlet war file. I am getting “Form Failure: The Context Path is either empty or not defined.” in the tasklist while trying to complete the task.

The strange thing is, if I restart the server/re-deploy the servlet war with the html file and refresh the tasklist page, it starts working as expected. Please help me with this.