"SOLR Special three" SOLR common exceptions

Source: Internet
Author: User
Tags error code solr tomcat apache tomcat


1. remotesolrexception:expected MIME type application/octet-stream but got text/html

Phenomenon:

slf4j:failed to load Class "Org.slf4j.impl.StaticLoggerBinder".
Slf4j:defaulting to No-operation (NOP) Logger implementation
Slf4j:see Http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" org.apache.solr.client.solrj.impl.httpsolrserver$remotesolrexception:expected MIME type Application/octet-stream but got text/html. At Org.apache.solr.client.solrj.impl.HttpSolrServer.executeMethod (httpsolrserver.java:516)
At Org.apache.solr.client.solrj.impl.HttpSolrServer.request (httpsolrserver.java:210)
At Org.apache.solr.client.solrj.impl.HttpSolrServer.request (httpsolrserver.java:206)
At Org.apache.solr.client.solrj.request.AbstractUpdateRequest.process (abstractupdaterequest.java:124)
At Org.apache.solr.client.solrj.SolrServer.add (solrserver.java:116)
At Org.apache.solr.client.solrj.SolrServer.add (solrserver.java:102)
At Org.ljh.test.solr.BasicSolrJIndexDemo.main (basicsolrjindexdemo.java:23)

Analysis:

The above exception occurs because the various errors caused SOLR to return an error page instead of the result of index success.

Where the above HTML code is formatted after rendering:

HTTP Status 405-http method POST is not supported by this URL

Type Status Report

Message HTTP method POST is not a supported by this URL

Description The specified HTTP method is not a allowed for the requested resource. Apache tomcat/7.0.54 Workaround:

After using Tomcat to deploy SOLR, the address of the Collection1 is: Http://ip:8080/solr/#/collection1, but when you use SOLRJ for indexing, you should use http://ip:8080/solr/ Collection1, that is, there is no middle # number.

That is, the correct code is:

String ServerURL = (args! = null && args.length > 0)? Args[0]
				: "Http://ip:8080/solr/collection1";
The error code is:

String ServerURL = (args! = null && args.length > 0)? Args[0]
				: "Http://ip:8080/solr/#/collection1";

The error code will cause the above error.






Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.