I tried the above solutions. But it didn't help me. Despite, I used the same commands which they mentioned with the changes of sequence. They are,
clear cache, composer_home, generation, log, page_cache, tmp and view_preprocessed from var directory
run the following commands one by one.
php bin/magento indexer:reindex
php bin/magento ccache:fflush
php bin/magento setup:static-content:deploy
I hope this may help to someone like me.