[ https://issues.apache.org/jira/browse/CONNECTORS-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13103465#comment-13103465 ]
Karl Wright commented on CONNECTORS-254: ---------------------------------------- I have some concerns about this approach. First, I'm not sure it is the right thing to do. It would be good to know more about the case you are comparing against when you say "On the other hand when using Solr request handler without MCF, this exception is not thrown and the posting 0 byte files is indexed normally." How are you posting the content normally? When you post the content in that way, what does the entire http request look like? You can use Wireshark to capture it, or I can, so we can see exactly what happens in that case. Second, if it turns out that adding a space is the correct thing to do, I'm concerned because this change is not being reflected in the content-length header. If the header reports a different length than what is posted, the posted data will be truncated. This may be the whole goal, though, in which case we should add a comment to the code noting that the content MUST be the last field posted for this reason. > Bad request when posting 0 byte file to Solr > -------------------------------------------- > > Key: CONNECTORS-254 > URL: https://issues.apache.org/jira/browse/CONNECTORS-254 > Project: ManifoldCF > Issue Type: Bug > Components: Lucene/SOLR connector > Affects Versions: ManifoldCF 0.1, ManifoldCF 0.2, ManifoldCF 0.3 > Reporter: Shinichiro Abe > Priority: Minor > Fix For: ManifoldCF 0.3 > > Attachments: CONNECTORS-254-1.patch, sample0byte.zip > > > It seems that httpposter brings about bad request when posting 0 byte file. > Solr log say the below. "missing content stream". Status code is 400. > On the other hand when using Solr request handler without MCF, this exception > is not thrown and the posting 0 byte files is indexed normally. > > 2011/09/13 12:30:40 org.apache.solr.core.SolrCore execute > ???: [] webapp=/solr path=/update/extract > params={literal.id=file:/Users/abe/Desktop/1/no-content/no-content.txt&literal.uri=/Users/abe/Desktop/1/no-content/no-content.txt} > status=400 QTime=367 > 2011/09/13 12:30:40 org.apache.solr.common.SolrException log > ?v???I: org.apache.solr.common.SolrException: missing content stream > at > org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:62) -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira