# No id property found for class

**URL:** <https://discuss.elastic.co/t/no-id-property-found-for-class/92927>\
**Category:** Elasticsearch\
**Created:** [July 13, 2017, 5:20am UTC](https://discuss.elastic.co/t/no-id-property-found-for-class/92927 "2017-07-13T05:20:52Z")\
**Posts on this page:** 2\
**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:** [July 13, 2017, 5:20am UTC](https://discuss.elastic.co/t/no-id-property-found-for-class/92927/1 "2017-07-13T05:20:52Z")

</div>

public void putMapping(Client client) {  
try {  
String parentMappings = XContentFactory.jsonBuilder()  
.startObject()  
.startObject(parentType)  
.startObject(PROPERTIES)  
.startObject("id").field("type", INTEGER\_TYPE).endObject()  
.startObject("basicproperty").field("type", INTEGER\_TYPE).endObject()  
.startObject("property").field("type", INTEGER\_TYPE).endObject()  
.startObject("mutation").field("type", INTEGER\_TYPE).endObject()  
.startObject("vacancyremission").field("type", INTEGER\_TYPE).endObject()  
.startObject("id\_demand").field("type", INTEGER\_TYPE).endObject()  
.startObject("transactiontype").field("tpe", STRING\_TYPE).field(INDEX, FieldIndex.not\_analyzed).endObject()  
.startObject("zone").field("type", INTEGER\_TYPE).endObject()  
.startObject("ward").field("type", INTEGER\_TYPE).endObject()  
.startObject("street").field("type", INTEGER\_TYPE).endObject()  
.startObject("block").field("type", INTEGER\_TYPE).endObject()  
.startObject("locality").field("type", INTEGER\_TYPE).endObject()  
.startObject("electionward").field("type", INTEGER\_TYPE).endObject()  
.startObject("ownersname").field("type", STRING\_TYPE).field(INDEX, FieldIndex.not\_analyzed).endObject()  
.startObject("doorno").field("type", STRING\_TYPE).field(INDEX, FieldIndex.not\_analyzed).endObject()  
.startObject("propertytype").field("type", INTEGER\_TYPE).endObject()  
.startObject("usage").field("type", STRING\_TYPE).field(INDEX, FieldIndex.not\_analyzed).endObject()  
.startObject("tax\_effdate").field("type", "date").endObject()  
.startObject("transaction\_date").field("type", "date").endObject()  
.endObject().endObject().endObject()  
.string();

when starting server I got exception--Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No id property found for class

---

<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:** [August 10, 2017, 5:20am UTC](https://discuss.elastic.co/t/no-id-property-found-for-class/92927/2 "2017-08-10T05:20:53Z")

</div>

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