: My code and solr were running as 2 different processes! ( Weird part is that : when I run the code using EmbeddedSolrServer, it did not throw any exception : that there was already a server running on that port. )
EmeddedSolrServer doesn't start up any port, or attempt to communicate with any external port -- it does what the name says: runs solr embeeded in your current application. -Hoss