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 Songtao Zheng <zh...@gmail.com> on 2014/06/06 22:11:24 UTC
Solr Realtime Get RemoteSolrException: Expected mime type
application/xml but got text/html
Solr version on remote server: solr-4.3.1 I am trying to use Solr Realtime
Get <http://wiki.apache.org/solr/RealTimeGet> to retrieve document before
commit. My code
class Test3
{
static main(args)
{
def test = new Test3()
test.run()
}
private run()
{
String url = "DEV_SERVER:8983/solr/emr"
HttpSolrServer solr = new HttpSolrServer(url)
SolrQuery q = new SolrQuery();
q.setRequestHandler("/get");
q.set("rid",
"6662c0f2.ee6a64fe.588j6qohe.9kd087u.0r00dg.6kr5pc2as0qu9m4ibr7f7");
QueryRequest req = new QueryRequest(q);
req.setResponseParser(new BinraryResponseParser());
println "=============================================="
rsp = req.process(solr); // ERROR
}
}
*The error stacktrace is:*
Caught:
org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException:
Expected mime type application/octet-stream but got
text/html. <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /solr/emr/get. Reason:
<pre> Not Found</pre></p><hr /><i><small>Powered by
Jetty://</small></i><br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
</body>
</html>
org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException:
Expected mime type application/octet-stream but got text/htm
l. <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /solr/emr/get. Reason:
<pre> Not Found</pre></p><hr /><i><small>Powered by
Jetty://</small></i><br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
</body>
</html>
at
org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:459)
at
org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:199)
at
org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:91)
at
org.apache.solr.client.solrj.request.QueryRequest$process.call(Unknown
Source)
at com.att.songtao.test.Test3.run(Test3.groovy:48)
at com.att.songtao.test.Test3.this$2$run(Test3.groovy)
at com.att.songtao.test.Test3$this$2$run.call(Unknown Source)
at com.att.songtao.test.Test3.main(Test3.groovy:14)
I am following Realtime Get document and added updateLog to updateHandler
in solrconfig.xml. My localhost "localhost:8983/solr/emr" (version
solr-4.7.2) Realtime Get works perfect, but having it on remote server
throws out the above error.
Anyone could provide the insight?
Thanks,
Songtao
Re: Solr Realtime Get RemoteSolrException: Expected mime type
application/xml but got text/html
Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
Since it is returning a 404, I guess the real time get handler is not
enabled on your remote Solr.
Make sure that your solrconfig.xml has the following somewhere:
<requestHandler name="/get" class="solr.RealTimeGetHandler">
<lst name="defaults">
<str name="omitHeader">true</str>
<str name="wt">json</str>
<str name="indent">true</str>
</lst>
</requestHandler>
On Sat, Jun 7, 2014 at 1:41 AM, Songtao Zheng <zh...@gmail.com>
wrote:
> Solr version on remote server: solr-4.3.1 I am trying to use Solr Realtime
> Get <http://wiki.apache.org/solr/RealTimeGet> to retrieve document before
> commit. My code
>
> class Test3
> {
> static main(args)
> {
> def test = new Test3()
> test.run()
> }
>
> private run()
> {
> String url = "DEV_SERVER:8983/solr/emr"
>
> HttpSolrServer solr = new HttpSolrServer(url)
>
> SolrQuery q = new SolrQuery();
> q.setRequestHandler("/get");
> q.set("rid",
> "6662c0f2.ee6a64fe.588j6qohe.9kd087u.0r00dg.6kr5pc2as0qu9m4ibr7f7");
>
> QueryRequest req = new QueryRequest(q);
> req.setResponseParser(new BinraryResponseParser());
>
> println "=============================================="
> rsp = req.process(solr); // ERROR
> }
> }
>
> *The error stacktrace is:*
> Caught:
> org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException:
> Expected mime type application/octet-stream but got
> text/html. <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
> <title>Error 404 Not Found</title>
> </head>
> <body><h2>HTTP ERROR 404</h2>
> <p>Problem accessing /solr/emr/get. Reason:
> <pre> Not Found</pre></p><hr /><i><small>Powered by
> Jetty://</small></i><br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
>
> </body>
> </html>
>
> org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException:
> Expected mime type application/octet-stream but got text/htm
> l. <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
> <title>Error 404 Not Found</title>
> </head>
> <body><h2>HTTP ERROR 404</h2>
> <p>Problem accessing /solr/emr/get. Reason:
> <pre> Not Found</pre></p><hr /><i><small>Powered by
> Jetty://</small></i><br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
>
> </body>
> </html>
>
> at
>
> org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:459)
> at
>
> org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:199)
> at
>
> org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:91)
> at
> org.apache.solr.client.solrj.request.QueryRequest$process.call(Unknown
> Source)
> at com.att.songtao.test.Test3.run(Test3.groovy:48)
> at com.att.songtao.test.Test3.this$2$run(Test3.groovy)
> at com.att.songtao.test.Test3$this$2$run.call(Unknown Source)
> at com.att.songtao.test.Test3.main(Test3.groovy:14)
>
>
> I am following Realtime Get document and added updateLog to updateHandler
> in solrconfig.xml. My localhost "localhost:8983/solr/emr" (version
> solr-4.7.2) Realtime Get works perfect, but having it on remote server
> throws out the above error.
>
> Anyone could provide the insight?
>
> Thanks,
>
> Songtao
>
--
Regards,
Shalin Shekhar Mangar.