lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From franagan <franciscomjoaq...@gmail.com>
Subject socket write error Solrj 4.3.1
Date Tue, 23 Jul 2013 20:44:03 GMT
Hi all,

im testing solrcloud (version 4.3.1) with 2 shards and 1 external zookeeper.
All its runing ok, documents are indexing in 2 diferent shards and select
*:* give me all documents.

Now im trying to add/index a new document via solj ussing CloudSolrServer.

*the code:*

			server = new CloudSolrServer("localhost:2181");
			server.setDefaultCollection("tika");
			server.setZkConnectTimeout(99999);	
			
			input = new FileInputStream(new File("C:\\sample.pdf"));
			
			ContentStreamUpdateRequest up = new
ContentStreamUpdateRequest("/update/extract");
			up.addFile(new File("C:\\caca.pdf"), "application/octet-stream");
			up.setParam("literal.id", "444");
			
			
			Parser parser = new PDFParser();
			ContentHandler handler = new BodyContentHandler();
			Metadata metadata = new Metadata();
			ParseContext context = new ParseContext();
		    parser.parse(input, handler, metadata, context);
					
			up.setParam("literal.text",handler.toString());
			up.setMethod(SolrRequest.METHOD.POST);
						
			server.request(up);
			server.commit();
			input.close();
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SolrServerException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

*My schema looks like this:*
 <fields>
 	 <field name="id" type="integer" indexed="true" stored="true"
required="true"/>
   <field name="title" type="string" indexed="true" stored="true"/>
   <field name="author" type="string" indexed="true" stored="true" />
   <field name="text" type="text_ind" indexed="true" stored="true" />   
   <field name="_version_" type="long" indexed="true" stored="true"/>    
   <dynamicField name="ignored_*" type="string" indexed="true"
stored="true"/>
 </fields>

*where text_ind type is like this:*
  <fieldType name="text_ind" class="solr.TextField"
positionIncrementGap="100">
  		<analyzer type="index">
  		<tokenizer class="solr.LetterTokenizerFactory"/>
    	<filter class="solr.EdgeNGramFilterFactory" minGramSize="3"
maxGramSize="25" />
    	<filter class="solr.LowerCaseFilterFactory"/>
    	</analyzer>
    </fieldType>

*when i execute code next exception is thrown:*

log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
more info.
org.apache.solr.client.solrj.SolrServerException: No live SolrServers
available to handle this
request:[http://192.168.1.12:8983/solr/tika_shard1_replica1,
http://192.168.1.12:8984/solr/tika_shard2_replica1]
	at
org.apache.solr.client.solrj.impl.LBHttpSolrServer.request(LBHttpSolrServer.java:333)
	at
org.apache.solr.client.solrj.impl.CloudSolrServer.request(CloudSolrServer.java:306)
	at solrCloud.solrJDemo.main(solrJDemo.java:51)
Caused by: org.apache.solr.client.solrj.SolrServerException: IOException
occured when talking to server at:
http://192.168.1.12:8983/solr/tika_shard1_replica1
	at
org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:413)
	at
org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:180)
	at
org.apache.solr.client.solrj.impl.LBHttpSolrServer.request(LBHttpSolrServer.java:264)
	... 2 more
Caused by: org.apache.http.client.ClientProtocolException
	at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:909)
	at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
	at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
	at
org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:352)
	... 4 more
Caused by: org.apache.http.client.NonRepeatableRequestException: Cannot
retry request with a non-repeatable request entity.  The cause lists the
reason the original request failed.
	at
org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:691)
	at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:522)
	at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
	... 7 more
Caused by: java.net.SocketException: Software caused connection abort:
socket write error
	at java.net.SocketOutputStream.socketWrite0(Native Method)
	at java.net.SocketOutputStream.socketWrite(Unknown Source)
	at java.net.SocketOutputStream.write(Unknown Source)
	at
org.apache.http.impl.io.AbstractSessionOutputBuffer.flushBuffer(AbstractSessionOutputBuffer.java:147)
	at
org.apache.http.impl.io.AbstractSessionOutputBuffer.write(AbstractSessionOutputBuffer.java:167)
	at
org.apache.http.impl.conn.LoggingSessionOutputBuffer.write(LoggingSessionOutputBuffer.java:74)
	at
org.apache.http.impl.io.ChunkedOutputStream.flushCacheWithAppend(ChunkedOutputStream.java:110)
	at
org.apache.http.impl.io.ChunkedOutputStream.write(ChunkedOutputStream.java:165)
	at
org.apache.http.entity.InputStreamEntity.writeTo(InputStreamEntity.java:92)
	at
org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:98)
	at
org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
	at
org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:122)
	at
org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:271)
	at
org.apache.http.impl.conn.ManagedClientConnectionImpl.sendRequestEntity(ManagedClientConnectionImpl.java:197)
	at
org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:257)
	at
org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
	at
org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:717)
	... 9 more

Them problem is the line:
			up.setParam("literal.text",handler.toString());

if i comment this line or asign a short value to literal.text, the code
work's ok. the pdf is small, about 500KB.

Someone Know what im doing wrong?

I have read about the solrj default uses GET.... but i have set explicit to
post method:

up.setMethod(SolrRequest.METHOD.POST);

Thanks in advance.




--
View this message in context: http://lucene.472066.n3.nabble.com/socket-write-error-Solrj-4-3-1-tp4079869.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message