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 Jenny Huang <su...@gmail.com> on 2013/06/15 00:26:25 UTC
strange solr version error
Hi,
I need to use solrj to do a full data import from a table in database, and
encountered the solr version error: "java.lang.RuntimeException: Invalid
version (expected 2, but 60) or the data in not in 'javabin' format". To
figure out what went wrong, I stripped the program to bare bone and let it
run data import for the 'db' in solr tutorial example-DIH
(\solr-4.3.0\example\example-DIH), and experienced the same version error.
I downloaded and run the most recent solr-4.3.0 in window 7, and pulled the
same version of solrj when writing the small solrj program for data import
(see below maven import).
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId>
<version>4.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-core</artifactId>
<version>4.3.0</version>
</dependency>
The main part of data import solrj program is very simple, see below.
public class DbDataImportClient {
public void fullImport(String url) {
try {
HttpSolrServer server = new HttpSolrServer(url);
ModifiableSolrParams params = new ModifiableSolrParams();
params.set("qt", "/dataimport");
params.set("command", "full-import");
server.query(params);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
String url = "http://localhost:8983/solr/#/db";
new DbDataImportClient().fullImport(url);
}
}
I have been going through almost all the pieces of internet search for that
error for two days. Majority of them are about incompatible versions. I
don't think it's my case. I am at my wits end on what went wrong, and
really need help in the problem.
Thanks ahead.
-Jenny
Re: strange solr version error
Posted by Jenny Huang <su...@gmail.com>.
Thanks a lot, Shawn. It works now.
Have a nice weekend,
-Jenny
<http://localhost:8983/solr/db>
On Fri, Jun 14, 2013 at 6:47 PM, Shawn Heisey <so...@elyograg.org> wrote:
> On 6/14/2013 4:26 PM, Jenny Huang wrote:
> > Hi,
> >
> > I need to use solrj to do a full data import from a table in database,
> and
> > encountered the solr version error: "java.lang.RuntimeException: Invalid
> > version (expected 2, but 60) or the data in not in 'javabin' format". To
> > figure out what went wrong, I stripped the program to bare bone and let
> it
> > run data import for the 'db' in solr tutorial example-DIH
> > (\solr-4.3.0\example\example-DIH), and experienced the same version
> error.
>
> This error actually means that the response you are getting is HTML
> rather than javabin.
>
> The reason you are getting the error is because you have given SolrJ a
> URL from the admin UI, not a core base URL for API calls. Use this
> instead:
>
> String url = "http://localhost:8983/solr/db";
>
> Thanks,
> Shawn
>
>
Re: strange solr version error
Posted by Shawn Heisey <so...@elyograg.org>.
On 6/14/2013 4:26 PM, Jenny Huang wrote:
> Hi,
>
> I need to use solrj to do a full data import from a table in database, and
> encountered the solr version error: "java.lang.RuntimeException: Invalid
> version (expected 2, but 60) or the data in not in 'javabin' format". To
> figure out what went wrong, I stripped the program to bare bone and let it
> run data import for the 'db' in solr tutorial example-DIH
> (\solr-4.3.0\example\example-DIH), and experienced the same version error.
This error actually means that the response you are getting is HTML
rather than javabin.
The reason you are getting the error is because you have given SolrJ a
URL from the admin UI, not a core base URL for API calls. Use this instead:
String url = "http://localhost:8983/solr/db";
Thanks,
Shawn