I have solved the problem by declaring the TikaEntityProcessor inside the main entity. I am sharing the correct code for information.