actually I had a problem with missing config file from the servlet.
The problem was resolved when I used getSerlvetContext().getResourceAsStream instead of getClass().getResourceAsStream()