# When pushing data in child document getting null pointer exception as id is null

**URL:** <https://discuss.elastic.co/t/when-pushing-data-in-child-document-getting-null-pointer-exception-as-id-is-null/89653>\
**Category:** Elasticsearch\
**Created:** [June 16, 2017, 6:26am UTC](https://discuss.elastic.co/t/when-pushing-data-in-child-document-getting-null-pointer-exception-as-id-is-null/89653 "2017-06-16T06:26:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![RahulRoyeGov](https://avatars.discourse-cdn.com/v4/letter/r/74df32/32.png) [@RahulRoyeGov](https://discuss.elastic.co/u/RahulRoyeGov)\
**Post date:** [June 16, 2017, 6:26am UTC](https://discuss.elastic.co/t/when-pushing-data-in-child-document-getting-null-pointer-exception-as-id-is-null/89653/1 "2017-06-16T06:26:55Z")

</div>

org.elasticsearch.transport.RemoteTransportException: [Abyss][127.0.0.1:9350][indices:data/write/bulk]  
Caused by: java.lang.NullPointerException: id must not be null  
at java.util.Objects.requireNonNull(Objects.java:228) ~[?:1.8.0\_131]  
at org.elasticsearch.action.RoutingMissingException.(RoutingMissingException.java:43) ~[elasticsearch-2.3.3.jar:2.3.3]

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 16, 2017, 6:39am UTC](https://discuss.elastic.co/t/when-pushing-data-in-child-document-getting-null-pointer-exception-as-id-is-null/89653/2 "2017-06-16T06:39:15Z")

</div>

Moved to #elasticsearch

You probably did not provide the parent id?

---

<div class="post-metadata">

**Author:** ![RahulRoyeGov](https://avatars.discourse-cdn.com/v4/letter/r/74df32/32.png) [@RahulRoyeGov](https://discuss.elastic.co/u/RahulRoyeGov)\
**Post date:** [June 16, 2017, 7:44am UTC](https://discuss.elastic.co/t/when-pushing-data-in-child-document-getting-null-pointer-exception-as-id-is-null/89653/3 "2017-06-16T07:44:27Z")

</div>

my index is like this:

curl -XPUT localhost:9250/assmtdmdcollectn -d '{ "settings": { "number\_of\_shards" : 10}, "mappings": {"assessmenttransactions": {"properties": {"id": {"type": "integer"},"transactiontype": {"type": "string", "index":"not\_analyzed"}, "zone": {"type": "string", "index":"not\_analyzed"},"ward": {"type": "string", "index":"not\_analyzed"}, "locality": {"type": "string", "index":"not\_analyzed"},"ownername": {"type": "string", "index":"not\_analyzed"}, "doorno": {"type": "string", "index":"not\_analyzed"}, "taxeffectivedate": {"type": "date"}, "transactiondate": {"type": "date"} } }, "installmentdemand": {"\_parent": {"type": "assessmenttransactions"},"\_routing":{"required":"true"},"properties": {"iddemand":{"type":"integer"},"assessment\_transaction": {"type": "integer"}, "installment": {"type": "integer"}, "demand": {"type": "double"}, "totalcollection": {"type": "double"}, "advance": {"type": "double"} } }, "installmentcollectioninfo": {"\_parent": {"type": "installmentdemand"},"\_routing":{"required": true},"properties" : {"idcollection":{"type":"integer"},"installmentdemandinfo" : {"type": "integer"}, "collectiondate" : {"type": "date"}, "recieptnumber" : {"type": "string", "index":"not\_analyzed"}, "amount" : {"type": "integer"} } } } }'

Query for push parent document:

#!/bin/bash

export JDBC\_IMPORTER\_HOME=/home/rahulroy/softwares/elasticsearch-jdbc-2.3.3.0  
export ES\_HOME=/home/rahulroy/softwares/elasticsearch-jdbc-2.3.3.0  
bin=$JDBC\_IMPORTER\_HOME/bin  
lib=$JDBC\_IMPORTER\_HOME/lib

echo '  
{  
"type": "jdbc",  
"jdbc": {  
"url": "jdbc:postgresql://localhost:5432/Narasaraopet",  
"user": "postgres",  
"password": "postgres",  
"strategy": "standard",  
"timezone": "localtime",  
"sql": "SELECT id as "\_id", id, transactiontype, zone, ward, street,locality,ownersname, doorno, tax\_effectivedate, transaction\_date FROM egpt\_assessment\_transactions",  
"index": "assmtdmdcollectn",  
"type": "assessmenttransactions",  
"elasticsearch" : {  
"cluster" : "rahulelasticsearch",  
"host" : "localhost",  
"port" : 9350  
}  
}  
}' | java   
-cp "${lib}/\*"   
-Dlog4j.configurationFile=${bin}/log4j2.xml   
org.xbib.tools.Runner   
org.xbib.tools.JDBCImporter

---

<div class="post-metadata">

**Author:** ![RahulRoyeGov](https://avatars.discourse-cdn.com/v4/letter/r/74df32/32.png) [@RahulRoyeGov](https://discuss.elastic.co/u/RahulRoyeGov)\
**Post date:** [June 16, 2017, 7:45am UTC](https://discuss.elastic.co/t/when-pushing-data-in-child-document-getting-null-pointer-exception-as-id-is-null/89653/4 "2017-06-16T07:45:07Z")

</div>

Nd child document :  
#!/bin/bash

export JDBC\_IMPORTER\_HOME=/home/rahulroy/softwares/elasticsearch-jdbc-2.3.3.0  
export ES\_HOME=/home/rahulroy/softwares/elasticsearch-jdbc-2.3.3.0  
bin=$JDBC\_IMPORTER\_HOME/bin  
lib=$JDBC\_IMPORTER\_HOME/lib

echo '  
{  
"type": "jdbc",  
"jdbc": {  
"url": "jdbc:postgresql://localhost:5432/Narasaraopet",  
"user": "postgres",  
"password": "postgres",  
"strategy": "standard",  
"timezone": "localtime",  
"sql": "SELECT assessment\_transactions, installment, demand,totalcollection,advance FROM egpt\_installment\_demand\_info ",  
"index": "assmtdmdcollectn",  
"type": "installmentdemand",  
"parent":"assessmenttransactions",  
"elasticsearch" : {  
"cluster" : "rahulelasticsearch",  
"host" : "localhost",  
"port" : 9350  
}  
}  
}' | java   
-cp "${lib}/\*"   
-Dlog4j.configurationFile=${bin}/log4j2.xml   
org.xbib.tools.Runner   
org.xbib.tools.JDBCImporter

---

<div class="post-metadata">

**Author:** ![RahulRoyeGov](https://avatars.discourse-cdn.com/v4/letter/r/74df32/32.png) [@RahulRoyeGov](https://discuss.elastic.co/u/RahulRoyeGov)\
**Post date:** [June 16, 2017, 7:45am UTC](https://discuss.elastic.co/t/when-pushing-data-in-child-document-getting-null-pointer-exception-as-id-is-null/89653/5 "2017-06-16T07:45:52Z")

</div>

While pushing data to child index it is giving that error.please help

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 16, 2017, 8:13am UTC](https://discuss.elastic.co/t/when-pushing-data-in-child-document-getting-null-pointer-exception-as-id-is-null/89653/6 "2017-06-16T08:13:17Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

I know a little about JDBC Importer project. @jprante might probably provide a better support then.

---

<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 14, 2017, 8:13am UTC](https://discuss.elastic.co/t/when-pushing-data-in-child-document-getting-null-pointer-exception-as-id-is-null/89653/7 "2017-07-14T08:13:33Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
