Discussion:
Expected mime type application/octet-stream but got text/html
Shoaib
2017-10-17 06:07:38 UTC
Permalink
I have been following tutorial from below link to implement Spring data Solr

http://www.baeldung.com/spring-data-solr

Attached is my config file, model and repository for spring data solr.

when i make any query or save my model i receive the below exception.....
my solr is working fine when i ping from browser "
http://127.0.0.1:8983/solr/"

MerchantModel model = new MerchantModel();
model.setId("2");
model.setLocation("31.5287,74.4121");
model.setTitle("khawaja");
merchantRepository.save(model);

upon save i am getting the below exception
###############################################
org.springframework.data.solr.UncategorizedSolrException: Error from server
at http://127.0.0.1:8983/solr: Expected mime type application/octet-stream
but got text/html. <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /solr/update. Reason:
<pre> Not Found</pre></p>
</body>
</html>
; nested exception is
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error
from server at http://127.0.0.1:8983/solr: Expected mime type
application/octet-stream but got text/html. <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /solr/update. Reason:
<pre> Not Found</pre></p>
</body>
</html>
###############################################







Regards,





Khawaja MUHAMMAD Shoaib


Software Engineering Department


Inov8 Limited - Enabling the mobile payments ecosystem since 2004







GSM: +92 (322) 4001158


Email: <mailto:***@inov8.com.pk> ***@inov8.com.pk


URL: <http://www.inov8.com.pk/> www.inov8.com.pk
Jason Gerlowski
2017-10-17 17:06:03 UTC
Permalink
At a glance, I'd guess that your SolrClient object isn't setup correctly,
probably because it has the wrong "baseURL" specified. Solr has a
"/solr/<collection>/update" URL, but the error above makes it look like
your application is reaching out to "/solr/update" which isn't a valid
endpoint.

If your SolrClient is setup with a baseUrl like "http://localhost:8983/solr",
add a collection or core to the end of the url, such as:
"http:/localhost:8983/solr/some-valid-collection".
Post by Shoaib
I have been following tutorial from below link to implement Spring data Solr
http://www.baeldung.com/spring-data-solr
Attached is my config file, model and repository for spring data solr.
when i make any query or save my model i receive the below exception.....
my solr is working fine when i ping from browser "
http://127.0.0.1:8983/solr/"
MerchantModel model = new MerchantModel();
model.setId("2");
model.setLocation("31.5287,74.4121");
model.setTitle("khawaja");
merchantRepository.save(model);
upon save i am getting the below exception
###############################################
org.springframework.data.solr.UncategorizedSolrException: Error from
server at http://127.0.0.1:8983/solr: Expected mime type
application/octet-stream but got text/html. <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<pre> Not Found</pre></p>
</body>
</html>
Error from server at http://127.0.0.1:8983/solr: Expected mime type
application/octet-stream but got text/html. <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<pre> Not Found</pre></p>
</body>
</html>
###############################################
Regards,
Khawaja MUHAMMAD Shoaib
Software Engineering Department
*Inov8 Limited* - *Enabling the mobile payments ecosystem since 2004*
GSM: +92 (322) 4001158
URL: www.inov8.com.pk
Continue reading on narkive:
Loading...