Java solr异常需要mime类型的应用程序/八位字节流,但得到text/html
嗨,我正在尝试使用SpringBootDataSolr在solr中索引一个实体。但我有个例外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.
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));
}