On 5/27/2013 6:15 AM, Hans-Peter Stricker wrote: > I'm writing my first little Solrj program, but don't get it running because > of an RemoteSolrException: Server at http://localhost:8983/solr returned non > ok status:404 > > The server is definitely running and the url works in the browser. > > I am working with Solr 4.3.0.
Hans, To use SolrJ against the URL that you provided, you must have a defaultCoreName attribute in solr.xml that points at a core that exists. The defaultCoreName used in the old-style solr.xml (4.3.1 and earlier) is collection1. The new-style solr.xml (4.4 and later, when released) does not define a default core name. A far safer option for any Solr client API is to use a base URL that includes the name of the core. If you are using SolrCloud, you can optionally use the collection name instead. This option will be required for the new style solr.xml. Here's the format: http://server:port/solr/corename In the UI, the cores that exist will be in a left-side dropdown that says "Core Selector." If you are using SolrCloud, you can click on the Cloud option in the UI and then on Graph to see the collection names. They will be on the left side of the graph. NB: If you are using SolrCloud, it is better to use CloudSolrServer instead of HttpSolrServer. Thanks, Shawn