solr6.3通过solrj连接solr服务时 Expected mime type application/octet-stream but got text/html解决方案
来源:互联网 发布:bosa magine 淘宝天猫 编辑:程序博客网 时间:2024/06/06 03:13
在使用tomcat部署时,通过浏览器访问时的路径http://localhost:8080/solr/#/lcm-core";但是在使用solrj连接时需要将中间的#号去除
// private static String baseUrl = "http://localhost:8080/solr/#/lcm-core";//错误
private static String baseUrl = "http://localhost:8080/solr/lcm-core";
完整测试代码
package com.lcm.up;import org.apache.solr.client.solrj.SolrClient;import org.apache.solr.client.solrj.SolrQuery;import org.apache.solr.client.solrj.impl.HttpSolrClient;import org.apache.solr.client.solrj.response.QueryResponse;import org.junit.Test;/** * @ClassName: SolrJTest * @Description: solr使用测试 * </p> * @author cxf * @date 2016年12月6日 下午5:06:23 * */public class SolrJTest {//private static String baseUrl = "http://localhost:8080/solr/#/lcm-core";//错误private static String baseUrl = "http://localhost:8080/solr/lcm-core";public static final SolrClient server = new HttpSolrClient.Builder(baseUrl).build();/** * @Description: 查询关键字 * </p> */@Testpublic void testSoleJ(){try {SolrQuery query = new SolrQuery("*:*");QueryResponse resp = server.query(query);System.out.println(resp);} catch (Exception e) {e.printStackTrace();}}}
0 0
- solr6.3通过solrj连接solr服务时 Expected mime type application/octet-stream but got text/html解决方案
- Expected mime type application/octet-stream but got text/html.
- solr异常--Expected mime type application/octet-stream but got text/html.
- Solr 报错:RemoteSolrException: Expected mime type application/octet-stream but got text/html
- Solr 6.3 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
- SpringMVC Resource interpreted as Script but transferred with MIME type application/octet-stream:
- Resource interpreted as Stylesheet but transferred with MIME type application/octet-stream
- org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Expected mime type application
- Warning: unknown mime-type for "xxx" -- using "application/octet-stream"
- solr异常:org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Expected mime type appl
- "Could not find mime type application octet-stream"错误的解决方法
- Solrj连接Solr服务
- flv的MIME类型:flv-application/octet-stream
- application/octet-stream
- application/octet-stream
- ContentType("application/octet-stream");
- 搭建环境
- nodejs 爬取热点明星存入mysql数据库
- keil总是无法点击下拉菜单,无法右击,最后停止运行
- JMeter学习-013-JMeter 逻辑控制器之-如果(If)控制器
- 从零开始学Python06作业源码
- solr6.3通过solrj连接solr服务时 Expected mime type application/octet-stream but got text/html解决方案
- shell脚本定时执行php程序
- JPA 各种实体锁模式的区别
- 4.第二章.上机1-3
- onmousemove鼠标截取
- 两个相同效果的图片横向滚动 02-兼容IE8和Chrome浏览器
- Linux系统目录结构以及简单说明
- linux命令笔记(待补充)
- ScrollView中嵌套ListView或者GridView时的滑动冲突 || ListView中嵌套GridView,GridView只显示一行的问题解决