: I fixed the issue by URL encoding. Here is a slim down version of my code : (with the fix): ... : // Gives back: http://username:password@server:port/solr/... : String solrUrl = "http://" + username + ":" + password + "@" + : getSolrServerName() + ":" getSolrServerPort() + getSolrUpdatePathURI(); : : HttpSolrClient solrClient = new HttpSolrClient(solrUrl);
...if you're going to embedd the user+pass in the URL you pass to HttpSolrClient then you're absolutely going to be required to URL escape them yourself -- otherwise it's not a valid URL (at least, not in the way you want it to be) The official way to use BasicAuth with SolrJ is to set the credientials on the SolrRequest object via the setBasicAuthCredentials method... https://lucene.apache.org/solr/6_3_0/solr-solrj/org/apache/solr/client/solrj/SolrRequest.html#setBasicAuthCredentials-java.lang.String-java.lang.String- https://cwiki.apache.org/confluence/display/solr/Basic+Authentication+Plugin -Hoss http://www.lucidworks.com/