You're partly right. The solution in the link was for CommonsHttpSolrServer,
it does work for HttpSolrServer, but the principle is the same.
Actually, I found solution for the new HttpClient here:
http://stackoverflow.com/questions/2014700/preemptive-basic-authentication-with-apache-httpclient-4/1
I have protected my solr server with basic authentication. Now I want to
connect to it using SOLRJ. CommonsHttpSolrServer is now deprecated, so I try
to use HttpSolrServer, but I fail to send credentials. If I put them to the
url, I get 401 (http://user:passw...@example.com/solr). I tried this: