导航菜单
路很长,又很短
博主信息
昵   称:Cocodroid ->关于我
Q     Q:2531075716
博文数:337
阅读量:1472590
访问量:166454
至今:
×
云标签 标签球>>
云标签 - Su的技术博客
博文->>首页 博主的更多博文>>
Exception:Invalid version (expected 2, but 60) or the data in not in 'javabin' format in solr
Tags : Solr,javabin发表时间: 2015-09-01 18:28:35

I am getting a runtime exception when I am making the following simple call to ping my solr at localhost.

public static void main(String[] args) throws SolrServerException, IOException
    {
        String url = "http://127.0.0.1:8983/solr/#";
        HttpSolrServer solrServer = new HttpSolrServer(url);
        solrServer.ping();

    } 

The exception log is :

Exception in thread "main" java.lang.RuntimeException: Invalid version (expected 2, but     60) or the data in not in 'javabin' format
    at org.apache.solr.common.util.JavaBinCodec.unmarshal(JavaBinCodec.java:109)
    at         org.apache.solr.client.solrj.impl.BinaryResponseParser.processResponse(BinaryResponseParser.    java:41)
    at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:407)
    at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:180)
    at org.apache.solr.client.solrj.request.SolrPing.process(SolrPing.java:69)
    at org.apache.solr.client.solrj.SolrServer.ping(SolrServer.java:293)
    at com.tradus.LocalSolrDataAdd.main(LocalSolrDataAdd.java:26) 

Can someone explain how we can get rid of this apparently very weird error.

 
up vote2down voteaccepted

Here is a version of the code that seems to match your stacktrace:

The code seems to be trying to check the version number of response to the "ping" request. Your Solr client is getting a response that it doesn't understand. And my guess is that something has been misconfigured ... or you have given it the wrong URL.

Getting a version number of "60" instead of "2" seems unlikely. My guess is that the "60" is actually an< character ... which suggests to me that you have some XML or HTML rather than a binary response. In the latter case, it could be a page from the application container telling you that it doesn't understand your request ... or something.

I suggest that you check the server log files to see what requests it is getting. If that fails, try to capture the network traffic to / from your client.



 
打赏
打赏
关注公众号
公众号
类别:ES/Solr| 阅读(2490)| 赞 (0)
评论
暂无评论!
发表评论
昵  称:

验证码:

内  容:

    同时赞一个 赞