springboot整合elasticsearch出错:java.lang.NoClassDefFoundError: org/elasticsearch/plugins/NetworkPlugin...

Caused by: java.lang.NoClassDefFoundError: org/elasticsearch/plugins/NetworkPlugin
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_191]
at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[na:1.8.0_191]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_191]
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468) ~[na:1.8.0_191]
at java.net.URLClassLoader.access$100(URLClassLoader.java:74) ~[na:1.8.0_191]
at java.net.URLClassLoader$1.run(URLClassLoader.java:369) ~[na:1.8.0_191]
at java.net.URLClassLoader$1.run(URLClassLoader.java:363) ~[na:1.8.0_191]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_191]
at java.net.URLClassLoader.findClass(URLClassLoader.java:362) ~[na:1.8.0_191]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_191]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[na:1.8.0_191]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_191]
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:88) ~[transport-5.5.2.jar:5.5.2]
at com.ylht.esdemo.MyConfig.client(MyConfig.java:32) ~[classes/:na]
at com.ylht.esdemo.MyConfig$$EnhancerBySpringCGLIB$$abb85892.CGLIB$client$0() ~[classes/:na]
at com.ylht.esdemo.MyConfig$$EnhancerBySpringCGLIB$$abb85892$$FastClassBySpringCGLIB$$2ed19f23.invoke() ~[classes/:na]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358) ~[spring-context-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at com.ylht.esdemo.MyConfig$$EnhancerBySpringCGLIB$$abb85892.client() ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_191]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_191]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.3.10.RELEASE.jar:4.3.10.RELEASE]
... 57 common frames omitted

解决办法:(红色是新添加的依赖,黑色是我自己原来的,参考:https://blog.csdn.net/u010882234/article/details/74941954


  org.elasticsearch
  elasticsearch
  5.5.2


  org.elasticsearch.client
  transport
  5.5.2


  org.apache.logging.log4j
  log4j-api
  2.7


  org.apache.logging.log4j
  log4j-core
  2.7


转载于:https://www.cnblogs.com/ylht/p/10195342.html

你可能感兴趣的:(springboot整合elasticsearch出错:java.lang.NoClassDefFoundError: org/elasticsearch/plugins/NetworkPlugin...)