You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Peri Subrahmanya <pe...@htcinc.com> on 2013/05/01 16:51:29 UTC

EmbeddedSolrServer

I m trying to use the EmbeddedSolrServer and here is my sample code:

CoreContainer.Initializer initializer = new CoreContainer.Initializer();
CoreContainer coreContainer = initializer.initialize();
EmbeddedSolrServer server = new EmbeddedSolrServer(coreContainer, "");

Upon running I get the following exception - java.lang.NoClassDefFoundError:
org/apache/solr/common/cloud/ZooKeeperException.

I m not sure why its complaining about ZooKeeper. Any ideas please?

Thank you,
Peri Subrahmanya




*** DISCLAIMER *** This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery.
NOTE: Regardless of content, this e-mail shall not operate to bind HTC Global Services to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.

Re: EmbeddedSolrServer

Posted by Shawn Heisey <so...@elyograg.org>.
On 5/2/2013 8:07 PM, Peri Subrahmanya wrote:
> I actually have a maven project with a declared solrj dependency (4.2.1); Do I need anything extra to get rid of the Zookeeper exception? I didn't see jars specific to zookeeper in the list below that I would need. Any more ideas please?

SolrJ has a dependency on zookeeper.  Not all uses of solrj will require
zookeeper, but maven cannot know how you intend to use it, so I don't
think anything can be done about automatically pulling it in.

Thanks,
Shawn


Re: EmbeddedSolrServer

Posted by Peri Subrahmanya <pe...@htcinc.com>.
I actually have a maven project with a declared solrj dependency (4.2.1); Do I need anything extra to get rid of the Zookeeper exception? I didn't see jars specific to zookeeper in the list below that I would need. Any more ideas please?

Thank you,
Peri Subrahmanya


On May 2, 2013, at 4:48 PM, Shawn Heisey <so...@elyograg.org> wrote:

> On 5/2/2013 1:43 PM, Alexandre Rafalovitch wrote:
>> Actually, I found it very hard to figure out the exact Jar
>> requirements for SolrJ. I ended up basically pointing at expanded
>> webapp's lib directory, which is a total overkill.
>> 
>> Would be nice to have some specific guidance on this issue.
> 
> I have a SolrJ app that uses HttpSolrServer.  Here is the list of jars
> in my lib directory relevant to SolrJ.  There are other jars related to
> the other functionality in my app that I didn't list here.  I take a
> very minimalistic approach for what I add to my lib directory.  I work
> out the minimum jars required to get it to compile, then I try the
> program out and determine which additional jars it needs one by one.
> 
> commons-io-2.4.jar
> httpclient-4.2.4.jar
> httpcore-4.2.4.jar
> httpmime-4.2.4.jar
> jcl-over-slf4j-1.7.5.jar
> log4j-1.2.17.jar
> slf4j-api-1.7.5.jar
> slf4j-log4j12-1.7.5.jar
> solr-solrj-4.2.1.jar
> 
> You might notice that my component versions are newer than what is
> included in dist/solrj-lib.  I have tested all of the functionality of
> my application, and I do not require the other jars found in
> dist/solrj-lib, including zookeeper.  When I add functionality in the
> future, if I run into a class not found exception, I will add the
> appropriate jar.
> 
> If I were using CloudSolrServer, zookeeper would be required.  With
> EmbeddedSolrServer, more Lucene and Solr jars are required, because that
> starts the Solr server itself within your application.
> 
> Thanks,
> Shawn
> 
> 
> 
> 
> 



*** DISCLAIMER *** This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery.
NOTE: Regardless of content, this e-mail shall not operate to bind HTC Global Services to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.



Re: EmbeddedSolrServer

Posted by Shawn Heisey <so...@elyograg.org>.
On 5/2/2013 1:43 PM, Alexandre Rafalovitch wrote:
> Actually, I found it very hard to figure out the exact Jar
> requirements for SolrJ. I ended up basically pointing at expanded
> webapp's lib directory, which is a total overkill.
> 
> Would be nice to have some specific guidance on this issue.

I have a SolrJ app that uses HttpSolrServer.  Here is the list of jars
in my lib directory relevant to SolrJ.  There are other jars related to
the other functionality in my app that I didn't list here.  I take a
very minimalistic approach for what I add to my lib directory.  I work
out the minimum jars required to get it to compile, then I try the
program out and determine which additional jars it needs one by one.

commons-io-2.4.jar
httpclient-4.2.4.jar
httpcore-4.2.4.jar
httpmime-4.2.4.jar
jcl-over-slf4j-1.7.5.jar
log4j-1.2.17.jar
slf4j-api-1.7.5.jar
slf4j-log4j12-1.7.5.jar
solr-solrj-4.2.1.jar

You might notice that my component versions are newer than what is
included in dist/solrj-lib.  I have tested all of the functionality of
my application, and I do not require the other jars found in
dist/solrj-lib, including zookeeper.  When I add functionality in the
future, if I run into a class not found exception, I will add the
appropriate jar.

If I were using CloudSolrServer, zookeeper would be required.  With
EmbeddedSolrServer, more Lucene and Solr jars are required, because that
starts the Solr server itself within your application.

Thanks,
Shawn


Re: EmbeddedSolrServer

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
Actually, I found it very hard to figure out the exact Jar
requirements for SolrJ. I ended up basically pointing at expanded
webapp's lib directory, which is a total overkill.

Would be nice to have some specific guidance on this issue.

Regards,
   Alex.
Personal blog: http://blog.outerthoughts.com/
LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
- Time is the quality of nature that keeps events from happening all
at once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD
book)


On Thu, May 2, 2013 at 3:17 PM, Erick Erickson <er...@gmail.com> wrote:
> because some of the underlying classes in SolrJ try to communicate
> with Zookeeper to intelligently route requests to leaders.
>
> It looks like you don't have your classpath pointed at the
> dist/solrj-lib, at least that would be my first guess...
>
> Best
> Erick
>
> On Wed, May 1, 2013 at 7:51 AM, Peri Subrahmanya
> <pe...@htcinc.com> wrote:
>> I m trying to use the EmbeddedSolrServer and here is my sample code:
>>
>> CoreContainer.Initializer initializer = new CoreContainer.Initializer();
>> CoreContainer coreContainer = initializer.initialize();
>> EmbeddedSolrServer server = new EmbeddedSolrServer(coreContainer, "");
>>
>> Upon running I get the following exception - java.lang.NoClassDefFoundError:
>> org/apache/solr/common/cloud/ZooKeeperException.
>>
>> I m not sure why its complaining about ZooKeeper. Any ideas please?
>>
>> Thank you,
>> Peri Subrahmanya
>>
>>
>>
>>
>> *** DISCLAIMER *** This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery.
>> NOTE: Regardless of content, this e-mail shall not operate to bind HTC Global Services to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.

Re: EmbeddedSolrServer

Posted by Erick Erickson <er...@gmail.com>.
because some of the underlying classes in SolrJ try to communicate
with Zookeeper to intelligently route requests to leaders.

It looks like you don't have your classpath pointed at the
dist/solrj-lib, at least that would be my first guess...

Best
Erick

On Wed, May 1, 2013 at 7:51 AM, Peri Subrahmanya
<pe...@htcinc.com> wrote:
> I m trying to use the EmbeddedSolrServer and here is my sample code:
>
> CoreContainer.Initializer initializer = new CoreContainer.Initializer();
> CoreContainer coreContainer = initializer.initialize();
> EmbeddedSolrServer server = new EmbeddedSolrServer(coreContainer, "");
>
> Upon running I get the following exception - java.lang.NoClassDefFoundError:
> org/apache/solr/common/cloud/ZooKeeperException.
>
> I m not sure why its complaining about ZooKeeper. Any ideas please?
>
> Thank you,
> Peri Subrahmanya
>
>
>
>
> *** DISCLAIMER *** This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery.
> NOTE: Regardless of content, this e-mail shall not operate to bind HTC Global Services to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.