# java.lang.IllegalArgumentException: \[invoiceItems\] is defined as an object in mapping \[invoiceHistory\] but this name is already used for a field in other types

**URL:** <https://discuss.elastic.co/t/java-lang-illegalargumentexception-invoiceitems-is-defined-as-an-object-in-mapping-invoicehistory-but-this-name-is-already-used-for-a-field-in-other-types/54163>\
**Category:** Elasticsearch\
**Created:** [June 28, 2016, 1:01pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-invoiceitems-is-defined-as-an-object-in-mapping-invoicehistory-but-this-name-is-already-used-for-a-field-in-other-types/54163 "2016-06-28T13:01:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rohan\_Dodeja](https://avatars.discourse-cdn.com/v4/letter/r/50afbb/32.png) [@Rohan\_Dodeja](https://discuss.elastic.co/u/Rohan_Dodeja)\
**Post date:** [June 28, 2016, 1:01pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-invoiceitems-is-defined-as-an-object-in-mapping-invoicehistory-but-this-name-is-already-used-for-a-field-in-other-types/54163/1 "2016-06-28T13:01:13Z")

</div>

I used mongo-connector to copy all specific collections to elastic and it terminates giving these errors :-

`[2016-06-28 18:19:36,517][DEBUG][action.admin.indices.mapping.put] [Left Hand] failed to put mappings on indices [[mycaptionlabsproddev]], type [invoiceHistory] java.lang.IllegalArgumentException: [invoiceItems] is defined as an object in mapping [invoiceHistory] but this name is already used for a field in other types at org.elasticsearch.index.mapper.MapperService.checkFieldUniqueness(MapperService.java:469) at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:335) at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:289) at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.applyRequest(MetaDataMappingService.java:303) at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.execute(MetaDataMappingService.java:230) at org.elasticsearch.cluster.service.InternalClusterService.runTasksForExecutor(InternalClusterService.java:468) at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:772) at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:231) at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:194) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) [2016-06-28 18:19:36,520][DEBUG][action.admin.indices.mapping.put] [Left Hand] failed to put mappings on indices [[mycaptionlabsproddev]], type [invoiceHistory] java.lang.IllegalArgumentException: [invoiceItems] is defined as an object in mapping [invoiceHistory] but this name is already used for a field in other types at org.elasticsearch.index.mapper.MapperService.checkFieldUniqueness(MapperService.java:469) at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:335) at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:289) at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.applyRequest(MetaDataMappingService.java:303) at org.elasticsearch.cluster.metadata.MetaDataMappingService$PutMappingExecutor.execute(MetaDataMappingService.java:230) at org.elasticsearch.cluster.service.InternalClusterService.runTasksForExecutor(InternalClusterService.java:468) at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:772) at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:231) at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:194) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) [2016-06-28 18:19:36,521][DEBUG][action.bulk] [Left Hand] [mycaptionlabsproddev][0] failed to execute bulk item (index)`

---

<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 5, 2017, 10:39pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-invoiceitems-is-defined-as-an-object-in-mapping-invoicehistory-but-this-name-is-already-used-for-a-field-in-other-types/54163/2 "2017-07-05T22:39:54Z")

</div>


