If you are banging your head because of this exception in Solr 4.6 you should do following things.
- Be sure that solrconfig.xml of your core has <luceneMatchVersion>4.6</luceneMatchVersion> tag.
- Be sure that you are loading data importer libraries properly. This can be done with a line similar to <lib dir=”../dist/” regex=”solr-dataimporthandler-.*\.jar” />.
- Be sure “../dist/” is properly resolved to the /{solr-home}/dist/ directory.
- The dist directory must have solr-dataimporthandler-4.6.1.jar and solr-dataimporthandler-extras-4.6.1.jar files. Notice that my version was version 4.6.1, check your Solr version.
- Download the Solr from official site and preferably US or EU backup mirrors and extract. Copy solr-4.6.1/dist/solr-4.6.1.war to /usr/local/tomcat/webapps/solr.war. This is to make sure that solr app is updated to the version. Your tomcat path may be different so mind that.
- Be sure that you have proper version of mysql connection of java in you tomcat lib directory of tomcat, which in my case was /usr/local/tomcat/lib.
Restart tomcat and you should be good. Look for error log to find what actually happening. The cause of this error is some library which still use older version like 4.3. But the function getScheme() was removed later. If it does not work I recommend that you reinstall the solr completely. To reinstall completely undeploy the Solr app from application manager, remove its folder in webapps/, home/solr/ etc and do the new install.