Discussion:
Expected mime type application/octet-stream but got text/html
nalsrini
2018-09-04 21:22:44 UTC
Permalink
Hi,I use Solr 5.3 and I don't have any collection. When I execute the
following code, I got this error:Error from server at http://:/solr-master:
Expected mime type application/octet-stream but got text/html.SolrClient
client = new HttpSolrClient("http://:/solr-master"); String sorld =
client.getById("c311cda2-1edc-577f-b00c-36310499c9b0");I am wondering why
this error?thanksSrini



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Shawn Heisey
2018-09-04 23:13:08 UTC
Permalink
Post by nalsrini
Hi,I use Solr 5.3 and I don't have any collection. When I execute the
Expected mime type application/octet-stream but got text/html.SolrClient
client = new HttpSolrClient("http://:/solr-master"); String sorld =
client.getById("c311cda2-1edc-577f-b00c-36310499c9b0");I am wondering why
this error?thanksSrini
It means that the response was an error, which Solr formats as HTML. 
SolrJ is expecting a binary response, but that's not what it got.  The
error *should* include the full response from the server.

If you can't get your program to display the entire error, which should
indicate what the problem was, then look in solr.log (Solr's logfile) on
the server to find the error message.  If you need help understanding
it, include the entire message here.  Such error messages are typically
many lines long.

Which specific version are you running?  Saying "Solr 5.3" is not
specific enough.  Knowing that can be important in understanding Java
stacktraces.

Thanks,
Shawn
nalsrini
2018-09-06 18:29:12 UTC
Permalink
Here is the error message I am getting:

https://screencast.com/t/XwEjA22jX <https://screencast.com/t/XwEjA22jX>



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Walter Underwood
2018-09-06 18:39:17 UTC
Permalink
I thought there was a fix for this in SolrJ. This is a bug. It is getting some error,
like a 400 or 503, but instead of reporting the error, it makes a different error about
the content-type.

That is just busted, but I can’t find a Jira for it.

wunder
Walter Underwood
***@wunderwood.org
http://observer.wunderwood.org/ (my blog)
Post by nalsrini
https://screencast.com/t/XwEjA22jX <https://screencast.com/t/XwEjA22jX>
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Alexandre Rafalovitch
2018-09-06 18:57:23 UTC
Permalink
Why is this http://host:port/solr-master/get? The normal URL is
http://host:port/solr/<collectionname>/<handler>. "get" as a handler
is fine, <collectionname> can be empty for "collection1" in older
Solr. But what is "solr-master" here and where is the required "/solr"
part? What is your collection name?

So, to me, either your URL is wrong or you were trying to do a custom
URL and your troubleshooting should be focused around that first.

Regards,
Alex.
Post by Walter Underwood
I thought there was a fix for this in SolrJ. This is a bug. It is getting some error,
like a 400 or 503, but instead of reporting the error, it makes a different error about
the content-type.
That is just busted, but I can’t find a Jira for it.
wunder
Walter Underwood
http://observer.wunderwood.org/ (my blog)
Post by nalsrini
https://screencast.com/t/XwEjA22jX <https://screencast.com/t/XwEjA22jX>
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Shawn Heisey
2018-09-07 15:28:09 UTC
Permalink
Post by nalsrini
https://screencast.com/t/XwEjA22jX
Alexandre covered things quite well.  It looks like you're using an
invalid URL.

Your original message shows this code:

SolrClient client = new HttpSolrClient("http://:/solr-master");

That is not a valid URL.  It is missing the hostname, the port, and
/solr-master is not the correct URL path.  The correct path would be
/solr and MIGHT need to be /solr/indexname ... depending on exactly how
the other code is written.  I prefer to use /solr and specify the
collection name when making the requests.

Also, this is a Tomcat error page.  Is it Solr that's running in Tomcat,
or are you running another application in Tomcat that is accessing Solr?

Running Solr in Tomcat became an unsupported configuration as of Solr
5.0.  It is something you can do, but we don't support it.

https://wiki.apache.org/solr/WhyNoWar

Thanks,
Shawn

Loading...