# Indexing from two different source shows Exception

**URL:** https://discuss.elastic.co/t/indexing-from-two-different-source-shows-exception/7066
**Category:** Elasticsearch
**Created:** [March 20, 2012, 6:37am UTC](https://discuss.elastic.co/t/indexing-from-two-different-source-shows-exception/7066 "2012-03-20T06:37:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![vijuitech](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vijuitech](https://discuss.elastic.co/u/vijuitech)
#### Post date: [March 20, 2012, 6:37am UTC](https://discuss.elastic.co/t/indexing-from-two-different-source-shows-exception/7066/1 "2012-03-20T06:37:22Z")

</div>

Hi,  
When I tried to index the data from two different sources I got  
an exception,

Here am sending 50 data from each source. But I am getting  
indexing Totally 50 data, but the actual data must be 100

Here I got the exception,

Error during indexation  
org.elasticsearch.ElasticSearchParseException: Failed to derive  
xcontent from (offset=0, length=0): []  
at  
org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFactory.java:  
147)  
at  
org.elasticsearch.common.xcontent.XContentHelper.createParser(XContentHelper.java:  
49)  
at  
org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:  
428)  
at  
org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:  
414)  
at  
org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:  
302)  
at  
org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
181)  
at  
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
487)  
at  
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
$AsyncShardOperationAction  
$1.run(TransportShardReplicationOperationAction.java:400)  
at java.util.concurrent.ThreadPoolExecutor  
$Worker.runTask(ThreadPoolExecutor.java:885)  
at java.util.concurrent.ThreadPoolExecutor  
$Worker.run(ThreadPoolExecutor.java:907)  
at java.lang.Thread.run(Thread.java:619)

Thanks and Regards,

George

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [March 20, 2012, 10:53am UTC](https://discuss.elastic.co/t/indexing-from-two-different-source-shows-exception/7066/2 "2012-03-20T10:53:44Z")

</div>

Do you have data that you index with the doc? It seems like the length of  
the data indexed is 0...

On Tue, Mar 20, 2012 at 8:37 AM, George Viju [vijuitech@gmail.com](mailto:vijuitech@gmail.com) wrote:

> Hi,  
> When I tried to index the data from two different sources I got  
> an exception,
> 
> Here am sending 50 data from each source. But I am getting  
> indexing Totally 50 data, but the actual data must be 100
> 
> Here I got the exception,
> 
> Error during indexation  
> org.elasticsearch.ElasticSearchParseException: Failed to derive  
> xcontent from (offset=0, length=0):   
> at
> 
> org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFactory.java:  
> 147)  
> at
> 
> org.elasticsearch.common.xcontent.XContentHelper.createParser(XContentHelper.java:  
> 49)  
> at  
> org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:  
> 428)  
> at  
> org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:  
> 414)  
> at
> 
> org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:  
> 302)  
> at
> 
> org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:  
> 181)  
> at
> 
> org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction
> 
> $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:  
> 487)  
> at
> 
> org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction  
> $AsyncShardOperationAction  
> $1.run(TransportShardReplicationOperationAction.java:400)  
> at java.util.concurrent.ThreadPoolExecutor  
> $Worker.runTask(ThreadPoolExecutor.java:885)  
> at java.util.concurrent.ThreadPoolExecutor  
> $Worker.run(ThreadPoolExecutor.java:907)  
> at java.lang.Thread.run(Thread.java:619)
> 
> Thanks and Regards,
> 
> George

---

<div class="post-metadata">

### Author: ![vijuitech](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vijuitech](https://discuss.elastic.co/u/vijuitech)
#### Post date: [March 21, 2012, 6:06am UTC](https://discuss.elastic.co/t/indexing-from-two-different-source-shows-exception/7066/3 "2012-03-21T06:06:44Z")

</div>

Thank You Shay.

cheers

George

On Mar 20, 3:53 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> Do you have data that you index with the doc? It seems like the length of  
> the data indexed is 0...
> 
> On Tue, Mar 20, 2012 at 8:37 AM, George Viju [vijuit...@gmail.com](mailto:vijuit...@gmail.com) wrote:
> 
> > Hi,  
> > When I tried to index the data from two different sources I got  
> > an exception,
> 
> > Here am sending 50 data from each source. But I am getting  
> > indexing Totally 50 data, but the actual data must be 100
> 
> > Here I got the exception,
> 
> > Error during indexation  
> > org.elasticsearch.ElasticSearchParseException: Failed to derive  
> > xcontent from (offset=0, length=0):   
> > at
> 
> > org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFactory. java:  
> > 147)  
> > at
> 
> > org.elasticsearch.common.xcontent.XContentHelper.createParser(XContentHelpe r.java:  
> > 49)  
> > at  
> > org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:  
> > 428)  
> > at  
> > org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:  
> > 414)  
> > at
> 
> > org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(Inter nalIndexShard.java:  
> > 302)  
> > at
> 
> > org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary (TransportIndexAction.java:  
> > 181)  
> > at
> 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOpera tionAction
> 
> > $AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperat ionAction.java:  
> > 487)  
> > at
> 
> > org.elasticsearch.action.support.replication.TransportShardReplicationOpera tionAction  
> > $AsyncShardOperationAction  
> > $1.run(TransportShardReplicationOperationAction.java:400)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.runTask(ThreadPoolExecutor.java:885)  
> > at java.util.concurrent.ThreadPoolExecutor  
> > $Worker.run(ThreadPoolExecutor.java:907)  
> > at java.lang.Thread.run(Thread.java:619)
> 
> > Thanks and Regards,
> 
> > George

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 3:35am UTC](https://discuss.elastic.co/t/indexing-from-two-different-source-shows-exception/7066/4 "2017-07-06T03:35:20Z")

</div>


