开发者社区> 问答> 正文

Solr Expected mime type application/octe?400报错

我搭建了一套 Solr5.5.5 的环境  spring-data-solr也是5.5.5版本  使用的是内置的服务器运行的,控制台操控solr正常但是,集成到Springboot后疯狂报错!

控制台截图如下:

springboot环境如下:

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-data-solr</artifactId>
</dependency>

 

配置文件如下:

#application.properties   并不是yml格式,不知道有没有影响
spring.data.solr.host=http://127.0.0.1:8983/solr/new_core

代码如下

@Autowired
private SolrClient solrClient
public class ArticleViewServiceImplimplements ArticleViewService {
    @Override 
    public List<Article> testSolr() throws IOException, SolrServerException { 
        SolrQuery solrQuery = new SolrQuery();         solrQuery.set("q","id:34306219391547cc8f817c08bae95177");
        QueryResponse query = solrClient.query(solrQuery); 
        for (SolrDocument result : query.getResults()) { 
            System.out.println(result.get("new_title")); 
        } 
        return null; 
    }
}

启动报错信息如下(启动报错)

 

2019-07-24 10:48:26.038 [RMI TCP Connection(5)-10.0.101.76] WARN  o.s.boot.actuate.health.SolrHealthIndicator - Health check failed
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://127.0.0.1:8983/solr/new_core: 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/new_core/admin/cores. Reason:
<pre>    Not Found</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

</body>
</html>

大佬们,谢谢大佬们 

展开
收起
爱吃鱼的程序员 2020-06-05 15:39:29 821 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
                        <p>顶一下</p>
                    
    
                        <p>springboot吧? 调整你的boot版本就可以了. </p>
                    
    
                            springboot版本不能更改.....
                        
    
                        <p>commit的时候加,core 名称了吗?</p>
    
    2020-06-05 15:39:43
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
How to Integrate Spark MLlib and Apache Solr to Build Real-Time Entity Type Recognition System for Better Query Understanding 立即下载
Custom applicationgs 立即下载
Apache Wicket User Guide-Refer 立即下载