# Elasticsearch 5.0.0 aggregation error help plz

**URL:** <https://discuss.elastic.co/t/elasticsearch-5-0-0-aggregation-error-help-plz/65186>\
**Category:** Elasticsearch\
**Created:** [November 7, 2016, 9:05am UTC](https://discuss.elastic.co/t/elasticsearch-5-0-0-aggregation-error-help-plz/65186 "2016-11-07T09:05:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![soo](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@soo](https://discuss.elastic.co/u/soo)\
**Post date:** [November 7, 2016, 9:05am UTC](https://discuss.elastic.co/t/elasticsearch-5-0-0-aggregation-error-help-plz/65186/1 "2016-11-07T09:05:15Z")

</div>

enviroments

- spring 4.3.3
- elasticsearch 2.4.1 -\> (today upgrade) elasticsearch 5.0.0
- java 8
- tomcat 8

* * *

> error msg  
> org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dashboardController': Injection of autowired dependencies failed; nested exception is java.lang.VerifyError: Bad type on operand stack  
> Exception Details:  
> Location:  
> com/log/watch/service/impl/ElasticHttpServiceImpl.searchServerList(Ljava/lang/String;)Lorg/elasticsearch/action/search/SearchResponse; @54: invokevirtual  
> Reason:  
> Type 'org/elasticsearch/search/aggregations/support/ValuesSourceAggregationBuilder' (current frame, stack[1]) is not assignable to 'org/elasticsearch/search/aggregations/AggregationBuilder'  
> Current Frame:  
> bci: @54  
> flags: { }  
> locals: { 'com/log/watch/service/impl/ElasticHttpServiceImpl', 'java/lang/String', 'org/elasticsearch/search/aggregations/support/ValuesSourceAggregationBuilder' }  
> stack: { 'org/elasticsearch/action/search/SearchRequestBuilder', 'org/elasticsearch/search/aggregations/support/ValuesSourceAggregationBuilder' }  
> Bytecode:  
> 0x0000000: 04b8 0314 c600 092a 2bb7 0325 b000 1272  
> 0x0000010: b800 3212 73b6 0034 4d2a b700 2103 bd00  
> 0x0000020: 0bb6 0022 04bd 000b 5903 2b53 b600 23b2  
> 0x0000030: 0024 b600 252c b600 2703 b600 28b6 0029  
> 0x0000040: b900 2a01 00c0 002b 4e2a b400 2f2d b600  
> 0x0000050: 30b0  
> Stackmap Table:  
> same\_frame(@13)

```
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:355)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1219)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:751)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
at org.springframework.context.support.AbstractApplicationContext.__refresh(AbstractApplicationContext.java:541)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java)

```

Caused by: java.lang.VerifyError: Bad type on operand stack

controller called autowired service 'ElasticHttpService'

aggregation code is

> AggregationBuilder serverListAggregationBuilder = AggregationBuilders.terms("server\_list").field("host");  
> SearchResponse response = getInstance().prepareSearch()  
> .setIndices(indices)  
> .setSearchType(SearchType.DFS\_QUERY\_THEN\_FETCH)  
> .addAggregation(serverListAggregationBuilder)  
> .setSize(0)  
> .execute()  
> .actionGet();

* * *

how to fix it...  
plz help....T^T

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 7, 2016, 1:53pm UTC](https://discuss.elastic.co/t/elasticsearch-5-0-0-aggregation-error-help-plz/65186/2 "2016-11-07T13:53:27Z")

</div>

Hey,

with those few code snippets it is almost impossible to help. Do you have a small reproducible example, so people can follow the steps you did?

Can you compile that Elasticsearch code without Spring being invoked?

Are you sure you dont have an old dependency lying around somewhere?

--Alex

---

<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:** [December 5, 2016, 1:53pm UTC](https://discuss.elastic.co/t/elasticsearch-5-0-0-aggregation-error-help-plz/65186/3 "2016-12-05T13:53:38Z")

</div>

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