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 Markus Jelsma <ma...@openindex.io> on 2012/11/02 11:38:36 UTC

trouble instantiating CloudSolrServer

Hi,

We use trunk but got SolrJ 4.0 from Maven. Creating an instance of CloudSolrServer fails because its constructor calls a not existing LBServer constructor, it attempts to create an instance by only passing a HttpClient. How is LBHttpSolrServer supposed to work without passing a SolrServer URL to it?

  public CloudSolrServer(String zkHost) throws MalformedURLException {
      this.zkHost = zkHost;
      this.myClient = HttpClientUtil.createClient(null);
      this.lbServer = new LBHttpSolrServer(myClient);
      this.updatesToLeaders = true;
  }

java.lang.NoSuchMethodError: org.apache.solr.client.solrj.impl.LBHttpSolrServer.<init>(Lorg/apache/http/client/HttpClient;[Ljava/lang/String;)V
        at org.apache.solr.client.solrj.impl.CloudSolrServer.<init>(CloudSolrServer.java:84)

Thanks,
Markus

RE: trouble instantiating CloudSolrServer

Posted by Markus Jelsma <ma...@openindex.io>.
Something was wrong on my machine, removing Nutch' build dir and cleanly rebuilding everything fixed the issue.
Thanks
 
-----Original message-----
> From:Mark Miller <ma...@gmail.com>
> Sent: Sat 03-Nov-2012 02:57
> To: solr-user@lucene.apache.org
> Subject: Re: trouble instantiating CloudSolrServer
> 
> I think the maven jars must be out of whack?
> 
> On Fri, Nov 2, 2012 at 6:38 AM, Markus Jelsma
> <ma...@openindex.io> wrote:
> > Hi,
> >
> > We use trunk but got SolrJ 4.0 from Maven. Creating an instance of CloudSolrServer fails because its constructor calls a not existing LBServer constructor, it attempts to create an instance by only passing a HttpClient. How is LBHttpSolrServer supposed to work without passing a SolrServer URL to it?
> >
> >   public CloudSolrServer(String zkHost) throws MalformedURLException {
> >       this.zkHost = zkHost;
> >       this.myClient = HttpClientUtil.createClient(null);
> >       this.lbServer = new LBHttpSolrServer(myClient);
> >       this.updatesToLeaders = true;
> >   }
> >
> > java.lang.NoSuchMethodError: org.apache.solr.client.solrj.impl.LBHttpSolrServer.<init>(Lorg/apache/http/client/HttpClient;[Ljava/lang/String;)V
> >         at org.apache.solr.client.solrj.impl.CloudSolrServer.<init>(CloudSolrServer.java:84)
> >
> > Thanks,
> > Markus
> 
> 
> 
> -- 
> - Mark
> 

RE: trouble instantiating CloudSolrServer

Posted by Markus Jelsma <ma...@openindex.io>.
Hi, i added the follow dependancy to Apache Nutch:
org="org.apache.solr" name="solr-solrj" rev="4.0.0"
 
 
-----Original message-----
> From:Lance Norskog <go...@gmail.com>
> Sent: Sat 03-Nov-2012 04:34
> To: solr-user@lucene.apache.org; markrmiller@gmail.com
> Subject: Re: trouble instantiating CloudSolrServer
> 
> What is the maven repo id & version for this?
> 
> ----- Original Message -----
> | From: "Mark Miller" <ma...@gmail.com>
> | To: solr-user@lucene.apache.org
> | Sent: Friday, November 2, 2012 6:52:10 PM
> | Subject: Re: trouble instantiating CloudSolrServer
> | 
> | I think the maven jars must be out of whack?
> | 
> | On Fri, Nov 2, 2012 at 6:38 AM, Markus Jelsma
> | <ma...@openindex.io> wrote:
> | > Hi,
> | >
> | > We use trunk but got SolrJ 4.0 from Maven. Creating an instance of
> | > CloudSolrServer fails because its constructor calls a not existing
> | > LBServer constructor, it attempts to create an instance by only
> | > passing a HttpClient. How is LBHttpSolrServer supposed to work
> | > without passing a SolrServer URL to it?
> | >
> | >   public CloudSolrServer(String zkHost) throws
> | >   MalformedURLException {
> | >       this.zkHost = zkHost;
> | >       this.myClient = HttpClientUtil.createClient(null);
> | >       this.lbServer = new LBHttpSolrServer(myClient);
> | >       this.updatesToLeaders = true;
> | >   }
> | >
> | > java.lang.NoSuchMethodError:
> | > org.apache.solr.client.solrj.impl.LBHttpSolrServer.<init>(Lorg/apache/http/client/HttpClient;[Ljava/lang/String;)V
> | >         at
> | >         org.apache.solr.client.solrj.impl.CloudSolrServer.<init>(CloudSolrServer.java:84)
> | >
> | > Thanks,
> | > Markus
> | 
> | 
> | 
> | --
> | - Mark
> | 
> 

Re: trouble instantiating CloudSolrServer

Posted by Lance Norskog <go...@gmail.com>.
What is the maven repo id & version for this?

----- Original Message -----
| From: "Mark Miller" <ma...@gmail.com>
| To: solr-user@lucene.apache.org
| Sent: Friday, November 2, 2012 6:52:10 PM
| Subject: Re: trouble instantiating CloudSolrServer
| 
| I think the maven jars must be out of whack?
| 
| On Fri, Nov 2, 2012 at 6:38 AM, Markus Jelsma
| <ma...@openindex.io> wrote:
| > Hi,
| >
| > We use trunk but got SolrJ 4.0 from Maven. Creating an instance of
| > CloudSolrServer fails because its constructor calls a not existing
| > LBServer constructor, it attempts to create an instance by only
| > passing a HttpClient. How is LBHttpSolrServer supposed to work
| > without passing a SolrServer URL to it?
| >
| >   public CloudSolrServer(String zkHost) throws
| >   MalformedURLException {
| >       this.zkHost = zkHost;
| >       this.myClient = HttpClientUtil.createClient(null);
| >       this.lbServer = new LBHttpSolrServer(myClient);
| >       this.updatesToLeaders = true;
| >   }
| >
| > java.lang.NoSuchMethodError:
| > org.apache.solr.client.solrj.impl.LBHttpSolrServer.<init>(Lorg/apache/http/client/HttpClient;[Ljava/lang/String;)V
| >         at
| >         org.apache.solr.client.solrj.impl.CloudSolrServer.<init>(CloudSolrServer.java:84)
| >
| > Thanks,
| > Markus
| 
| 
| 
| --
| - Mark
| 

Re: trouble instantiating CloudSolrServer

Posted by Mark Miller <ma...@gmail.com>.
I think the maven jars must be out of whack?

On Fri, Nov 2, 2012 at 6:38 AM, Markus Jelsma
<ma...@openindex.io> wrote:
> Hi,
>
> We use trunk but got SolrJ 4.0 from Maven. Creating an instance of CloudSolrServer fails because its constructor calls a not existing LBServer constructor, it attempts to create an instance by only passing a HttpClient. How is LBHttpSolrServer supposed to work without passing a SolrServer URL to it?
>
>   public CloudSolrServer(String zkHost) throws MalformedURLException {
>       this.zkHost = zkHost;
>       this.myClient = HttpClientUtil.createClient(null);
>       this.lbServer = new LBHttpSolrServer(myClient);
>       this.updatesToLeaders = true;
>   }
>
> java.lang.NoSuchMethodError: org.apache.solr.client.solrj.impl.LBHttpSolrServer.<init>(Lorg/apache/http/client/HttpClient;[Ljava/lang/String;)V
>         at org.apache.solr.client.solrj.impl.CloudSolrServer.<init>(CloudSolrServer.java:84)
>
> Thanks,
> Markus



-- 
- Mark