# NPE in ObjectMapper.parse

**URL:** <https://discuss.elastic.co/t/npe-in-objectmapper-parse/3828>\
**Category:** Elasticsearch\
**Created:** [January 25, 2011, 7:06pm UTC](https://discuss.elastic.co/t/npe-in-objectmapper-parse/3828 "2011-01-25T19:06:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![edecitre](https://avatars.discourse-cdn.com/v4/letter/e/ecae2f/32.png) [@edecitre](https://discuss.elastic.co/u/edecitre)\
**Post date:** [January 25, 2011, 7:06pm UTC](https://discuss.elastic.co/t/npe-in-objectmapper-parse/3828/1 "2011-01-25T19:06:23Z")

</div>

Hi there,

I have a river plugged to a couchdb that gets a few thousands documents updated.

I get the following NPE:

[DEBUG][action.bulk] [Evilhawk???] [germany][0]: Failed to execute bulk item (index) [index {[germany][db1][c20147700], source[{"\_rev":"1-e4e4f2b0aa87c0af9fbb6e1bf3f8b894","parents":{},"\_id":"c20147700","children":{"None":["c20171489"]},"properties":{"feature\_code":1111,"attributes":{"#D":"COUNTRY","#A":5,"#C":2,"#L":"GER","22":"EUR","IC":"DEU","#M":"M","12":0}},"type":"Feature"}]}]  
java.lang.NullPointerException  
at org.elasticsearch.index.mapper.xcontent.ObjectMapper.parse(ObjectMapper.java:294)  
at org.elasticsearch.index.mapper.xcontent.XContentDocumentMapper.parse(XContentDocumentMapper.java:430)  
at org.elasticsearch.index.mapper.xcontent.XContentDocumentMapper.parse(XContentDocumentMapper.java:368)  
at org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:230)  
at org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnPrimary(TransportShardBulkAction.java:123)  
at org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnPrimary(TransportShardBulkAction.java:61)  
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:418)  
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.access$200(TransportShardReplicationOperationAction.java:218)  
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:316)  
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
at java.lang.Thread.run(Thread.java:662)  
[2011-01-25 19:46:38,670][WARN][river.couchdb] [Evilhawk???] [couchdb][germany\_river] failed to executefailure in bulk execution:  
[0]: index [germany], type [db1], id [c20147700], message [NullPointerException[null]]

Is it because the document to index contains "parents":{} ?

Thanks for your help,  
E

---

<div class="post-metadata">

**Author:** ![edecitre](https://avatars.discourse-cdn.com/v4/letter/e/ecae2f/32.png) [@edecitre](https://discuss.elastic.co/u/edecitre)\
**Post date:** [January 26, 2011, 6:12pm UTC](https://discuss.elastic.co/t/npe-in-objectmapper-parse/3828/2 "2011-01-26T18:12:52Z")

</div>

The NPE is produced when using a wrong mapping.  
The "IC" field is a string, and not an object.  
I had in the mapping:  
"IC": { "properties": { "text": {"type": "string", "index": "not\_analyzed"} } }  
It should have been:  
"IC": { "type": "string", "index": "not\_analyzed"} }

E

---

<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, 4:13am UTC](https://discuss.elastic.co/t/npe-in-objectmapper-parse/3828/3 "2017-07-06T04:13:13Z")

</div>


