OK, this is working now. There were a couple of things going on, but the net-net was "classloading issues." The initial "no such core" problem was happening because the cores weren't initializing properly due to a NoClassDefFoundError. But after fixing that, I wound up with a pile of ClassCastExceptions... the kind you get when there are Classloader conflicts... I'd seen this kind of thing before when using Groovy (possibly because it does extra classloading trickery under the covers?) so I ported the program to plain old Java and it works fine.
No biggie... at this point, I've basiclaly decided I'm going to run Solr as a separate process anyway, and use the http based SolrJ client for integration, and that works fine even in the Groovy code. Thanks for all the help, tips and pointers! I've learned a lot about Solr in the past day or two. :-) Phil On Thu, Jan 5, 2012 at 7:45 PM, Phillip Rhodes <motley.crue....@gmail.com> wrote: > 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