Elasticsearch 5.0.0 aggregation error help plz


(hs) #1

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


(Alexander Reelsen) #2

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


(system) #3

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