Also note that an EmbeddedSolrServer is for a specific core, not for all cores 
(and thus solr.xml is not used).  My hunch is that you need to point to the 
core's home directory, not to the parent of solr.xml.

        Erik



On Jan 6, 2012, at 03:06 , Sven Maurmann wrote:

> Hi,
> 
> from your snippets the reason is not completely clear. There are a number of 
> reasons for not starting up the
> server. For example in case of a faulty configuration of the core 
> (solrconfig.xml, schema.xml) the core does
> not start and you get the reported error.
> 
> Best,
>   Sven
> 
> Am 06.01.2012 um 01:45 schrieb Phillip Rhodes:
> 
>> Hi all, I'm having an issue that I hope someone can shed some light on.
>> 
>> I have a Groovy program, using Solr 3.5, where I am attempting to use
>> EmbeddedSolrServer using the instructions shown here:
>> 
>> http://wiki.apache.org/solr/Solrj#EmbeddedSolrServer
>> 
>> to that end, I have code setup like this:
>> 
>> ...
>> 
>> System.setProperty('solr.solr.home',
>> '/usr/servers/solr/apache-solr-3.5.0/example/heceta');
>> CoreContainer.Initializer initializer = new CoreContainer.Initializer();
>> CoreContainer coreContainer = initializer.initialize();
>> 
>> EmbeddedSolrServer solrServer = new EmbeddedSolrServer(coreContainer, '' );
>> 
>> to initialize the solrServer.  But when I try to add a doc using the 
>> solrServer
>> instance, I get an exception:
>> 
>> org.apache.solr.common.SolrException: No such core:
>>      at 
>> org.apache.solr.client.solrj.embedded.EmbeddedSolrServer.request(EmbeddedSolrServer.java:104)
>>      at 
>> org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:105)
>>      at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:121)
>>      at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:106)
>>      at org.apache.solr.client.solrj.SolrServer$add.call(Unknown Source)
>>      at 
>> org.fogbeam.exp.IndexerWithOwnerInfo.indexFile(IndexerWithOwnerInfo.groovy:150)
>> 
>> 
>> My solr.xml looks like this:
>> 
>> <solr persistent="false">
>> 
>> <!--
>> adminPath: RequestHandler path to manage cores.
>>   If 'null' (or absent), cores will not be manageable via request handler
>> -->
>> <cores adminPath="/admin/cores" defaultCoreName="collection1">
>>   <core name="collection1" instanceDir="." />
>> </cores>
>> </solr>
>> 
>> 
>> 
>> Can somebody tell me if the documentation on how to set this up is
>> wrong, or if there is a solr bug, or if there
>> is just something I've missed in my configuration?
>> 
>> 
>> Thanks,
>> 
>> 
>> Phillip
> 

Reply via email to