Expected mime type application/octet-stream but got text/html.
2017-11-10 16:28
716 查看
在运行solr技术的工程的时候出现Expected mime type application/octet-stream but got text/html.错误
![](https://oscdn.geek-share.com/Uploads/Images/Content/201711/0d47ccb7a7c9055ed6bdcc3a9fd28266)
网上找的原因有:
在使用Tomcat部署Solr后,Collection1的地址为:http://ip:8080/solr/#/collection1,但使用SolrJ进行索引的时候,应该使用http://ip:8080/solr/collection1,即无中间的#号。
即正确代码为:
String serverUrl = (args != null && args.length > 0) ? args[0]
: "http://ip:8080/solr/collection1";
错误代码为:
String serverUrl = (args != null && args.length > 0) ? args[0]
: "http://ip:8080/solr/#/collection1";
但是我的是因为solrServer配置出错,正确的应该是:
<bean id="httpSolrServer" class="org.apache.solr.client.solrj.impl.HttpSolrServer">
<constructor-arg index="0" value="http://localhost:8081/solr"/>
</bean>
同时应该开启tomcat服务器中的startup.bat。这样子solr才能访问成功
网上找的原因有:
在使用Tomcat部署Solr后,Collection1的地址为:http://ip:8080/solr/#/collection1,但使用SolrJ进行索引的时候,应该使用http://ip:8080/solr/collection1,即无中间的#号。
即正确代码为:
String serverUrl = (args != null && args.length > 0) ? args[0]
: "http://ip:8080/solr/collection1";
错误代码为:
String serverUrl = (args != null && args.length > 0) ? args[0]
: "http://ip:8080/solr/#/collection1";
但是我的是因为solrServer配置出错,正确的应该是:
<bean id="httpSolrServer" class="org.apache.solr.client.solrj.impl.HttpSolrServer">
<constructor-arg index="0" value="http://localhost:8081/solr"/>
</bean>
同时应该开启tomcat服务器中的startup.bat。这样子solr才能访问成功
相关文章推荐
- solrj6.2异常--Expected mime type application/octet-stream but got text/html.
- solr异常--Expected mime type application/octet-stream but got text/html.
- solr异常--Expected mime type application/octet-stream but got text/html.
- solr6.3通过solrj连接solr服务时 Expected mime type application/octet-stream but got text/html解决方案
- Solr 6.3 Expected mime type application/octet-stream but got text/html解决方法
- Solr 报错:RemoteSolrException: Expected mime type application/octet-stream but got text/html
- solr异常--Expected mime type application/octet-stream but got text/html.
- Solr4.6 Expected content type application/octet-stream but got text/html 解决办法
- solrj使用报错:HttpSolrServer$RemoteSolrException: Expected mime type application/xml but got text/html
- Resource interpreted as Stylesheet but transferred with MIME type application/octet-stream
- Warning: unknown mime-type for "xxx" -- using "application/octet-stream"
- Resource interpreted as Script but transferred with MIME type text/html
- client found response content type of text/html charset=utf-8 but expected text/xml
- Resource interpreted as Stylesheet but transferred with MIME type text/html:以及Uncaught SyntaxError:
- 关于chrome Resource interpreted as Script but transferred with MIME type text/html的问题
- web——css和图片突然加载不了,console报错:Resource interpreted as script but transferred with MIME type text/html.
- 关于chrome Resource interpreted as Script but transferred with MIME type text/html的问题
- Java过滤器引发的异常:Resource interpreted as Stylesheet but transferred with MIME type text/html
- "Could not find mime type application octet-stream"错误的解决方法
- Chrome 报 Resource interpreted as Script but transferred with MIME type text/plain 警告的解决办法