Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/328.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java solr异常需要mime类型的应用程序/八位字节流,但得到text/html_Java_Spring Boot_Solr - Fatal编程技术网

Java solr异常需要mime类型的应用程序/八位字节流,但得到text/html

Java solr异常需要mime类型的应用程序/八位字节流,但得到text/html,java,spring-boot,solr,Java,Spring Boot,Solr,嗨,我正在尝试使用SpringBootDataSolr在solr中索引一个实体。但我有个例外 Caused by: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://localhost:8983/solr/portal: Expected mime type application/octet-stream but got text/html.

嗨,我正在尝试使用SpringBootDataSolr在solr中索引一个实体。但我有个例外

    Caused by: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://localhost:8983/solr/portal: 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/portal/publishers/update. Reason:
<pre>    Not Found</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

</body>
</html>
我的存储库界面

    @Resource
    BookRepository repository;
 @Override
    public void run(String... strings) throws Exception {
this.repository.save(new Publishers("4", "Sony Playstation","none", null));
}
已更新 我注意到实体类,即
publisher
name,会自动附加到URL。我不知道如何告诉应用程序在向solr发送调用时不要在solr URL中追加名称。
有人能帮我吗。提前感谢

检查您的URL是否正确

您应该将您的solr文档注释为@SolrDocument(solrCoreName=“You\u CORE\u NAME”)

在哪里和什么时候出现异常?当我保存我的发布者时,请查看我的运行()
    public interface BookRepository extends SolrCrudRepository<Publishers, String> {

    List<Publishers> findByName(String name);
}
    @Resource
    BookRepository repository;
 @Override
    public void run(String... strings) throws Exception {
this.repository.save(new Publishers("4", "Sony Playstation","none", null));
}