I think that if you don't define initParams then it fails with null pointer exception. Change it to: initParams.keySet()

Also, please format the code you have added.