I am using solrj to index to Solr through a Java application - I've tried
this both with Solr 4.8.1 and Solr 4.10.2, indexing to Solr 4.10.0.

I've found I cannot index too large content (a field with 400 words) or more
than 1 document at once to Solr instances from windows.  The exact same
indexing code works from linux, unchanged.  

I've found it does not work on Windows if:
1) I try to add more than 1 document at a time
2) I try to add a document with a long field value (400 words).

However in both cases it works fine if run from linux, or on windows if I
only add one document without very long values for any field.

The exception I get is the following:
org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException:
Invalid chunk header
        at
org.apache.solr.client.solrj.impl.HttpSolrServer.executeMethod(HttpSolrServer.java:552)
~[solr-solrj-4.10.2.jar:4.10.2 1634293 - mike - 2014-10-26 05:56:22]
        at
org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:210)
~[solr-solrj-4.10.2.jar:4.10.2 1634293 - mike - 2014-10-26 05:56:22]
        at
org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:206)
~[solr-solrj-4.10.2.jar:4.10.2 1634293 - mike - 2014-10-26 05:56:22]
        at
org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:124)
~[solr-solrj-4.10.2.jar:4.10.2 1634293 - mike - 2014-10-26 05:56:22]
        at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:68)
~[solr-solrj-4.10.2.jar:4.10.2 1634293 - mike - 2014-10-26 05:56:22]
        at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:54)
~[solr-solrj-4.10.2.jar:4.10.2 1634293 - mike - 2014-10-26 05:56:22]


My test code to reproduce this is the following:
    @Test
    public void testWriteBigOther() throws Exception {
        SolrServer solrServer = new
HttpSolrServer("http://my-vm:8080/solr/test_copy";);
        
        SolrInputDocument doc = new SolrInputDocument();
        doc.addField("asset_id","test_write_big");
        doc.addField("title", "test write big title"); 
        doc.addField("secondary_header", StringUtils.repeat("396"," ",400)); 
        
        List<SolrInputDocument> inputDocs = new
ArrayList<SolrInputDocument>();
        inputDocs.add(doc);
        
        solrServer.add(inputDocs);
        
        solrServer.commit();
        solrServer.shutdown();
    }

(it uses org.apache.commons.lang3.StringUtils repeat() method to generate
the large field value).


It seems like there must be a bug in SolrJ - i.e., I guess when it is
building the request it does something differently in windows vs. linux -
like maybe adds a carriage return on windows?  Does anyone know how to fix
this, or what else I could do to diagnose it?




--
View this message in context: 
http://lucene.472066.n3.nabble.com/Indexing-with-SolrJ-fails-on-windows-tp4170687.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to