Update version 1.7.2 to 2.0.0


(Kike) #1

Good Morning,

I 'm updating my maven java spring project with version 1.7.2 to 2.0.0 . In the pom.xml I modified versions :

<dependency>
      <groupId>org.elasticsearch</groupId>
      <artifactId>elasticsearch </artifactId>
      <version>2.2.0</version>
</dependency>

<dependency>
      <groupId>fr.pilato.spring</groupId>
      <artifactId>spring-elasticsearch</artifactId>
      <version>2.2.0</version>
</dependency>

But to throw my tomcat apache , I get an error such as :

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'client': Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
    ...
	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)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'client': Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1101)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1046)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck(AbstractAutowireCapableBeanFactory.java:860)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:790)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:542)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:436)
	... 21 more
Caused by: java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager
	at fr.pilato.spring.elasticsearch.ElasticsearchAbstractClientFactoryBean.<clinit>(ElasticsearchAbstractClientFactoryBean.java:150)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
	... 34 more
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
	... 42 more

Please , anyone have any idea what might be going ? I can not find the cause of the error.
Thank you very much , greetings


(David Pilato) #2

You meant 2.0.0 right? Not 2.2.0?

I think you are hitting this issue: https://github.com/dadoonet/spring-elasticsearch/issues/72

I need to review this proposal which will hopefully fix it: https://github.com/dadoonet/spring-elasticsearch/pull/78

This comment might help you in the meantime: https://github.com/dadoonet/spring-elasticsearch/issues/68#issuecomment-110997891


(system) #3