I am using solr-6.5.1
. I was able to install Solr, create a collection, index files using my application and also search for data from Solr. I was using the following URL to access Solr: http://localhost:8983/solr/swcm
Everything was working fine for me until today. Now when I try to access the above URL, it gives the following error:
HTTP ERROR 404
Problem accessing /solr/swcm. Reason:
Not Found
But if I use the following URL: http://localhost:8983/solr/#/swcm
I am able to access the Solr admin. But the issue with this url is when I try to search for data in the collection using my Spring MVC Java
application. I get the following exception:
SEVERE: Servlet.service() for servlet [appServlet] in context with path [/smartwcm-admin] threw exception [Request processing failed; nested exception is org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://localhost:8983/solr/#/swcm: Expected mime type application/xml but got text/html. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
And the code I use is:
solrClient = new HttpSolrClient.Builder("http://localhost:8983/solr/#/swcm").build();
solrClient.setParser(new XMLResponseParser());
SolrQuery query = new SolrQuery();
query.setQuery("pageTitle:"+searchKey+"*);
query.setFields("webContentDefinitionId");
query.setStart(start);
query.setRows(count);
query.set("defType", "edismax");
QueryResponse response = null;;
response = solrClient.query(query);
SolrDocumentList docList = response.getResults();
I am not sure what went wrong all of a sudden.