I have added following lines of code in solrconfig.xml file
<lib dir="../../../contrib/dataimporthandler/lib/" regex=".*\.jar" />
<lib dir="../../../dist/" regex="apache-solr-dataimporthandler-\d.*\.jar" />
make sure your apache-solr-dataimporthandler-4.0.jar and apache-solr-dataimporthandler-extras-4.0.jar files in the dist folder and it's in correct path.
don't forget to restart the tomcat server.
and that works for me.