我在尝试将spring数据与ElasticSearch集成时遇到了一个错误
2020-09-09 16:14:42 - Adding transport node : 127.0.0.1:9300
2020-09-09 16:14:47 - fatal error on the network layer
at org.elasticsearch.transport.netty4.Netty4Utils.maybeDie(Netty4Utils.java:184)
at org.elasticsearch.transport.netty4.Netty4Transport.initiateChannel(Netty4Transport.java:247)
at org.elasticsearch.transport.netty4.Netty4Transport.initiateChannel(Netty4Transport.java:82)
at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:604)
at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:122)
还有更多这样的错误
Exception in thread "Thread-7" java.lang.NoSuchMethodError: io.netty.util.ResourceLeakDetector.addExclusions(Ljava/lang/Class;[Ljava/lang/String;)V
at io.netty.buffer.AbstractByteBufAllocator.<clinit>(AbstractByteBufAllocator.java:34)
at io.netty.buffer.ByteBufUtil.<clinit>(ByteBufUtil.java:79)
at io.netty.buffer.ByteBufAllocator.<clinit>(ByteBufAllocator.java:24)
at io.netty.channel.DefaultChannelConfig.<init>(DefaultChannelConfig.java:56)
at io.netty.channel.DefaultChannelConfig.<init>(DefaultChannelConfig.java:69)
at io.netty.channel.socket.DefaultSocketChannelConfig.<init>(DefaultSocketChannelConfig.java:46)
at io.netty.channel.socket.nio.NioSocketChannel$NioSocketChannelConfig.<init>(NioSocketChannel.java:457)
at io.netty.channel.socket.nio.NioSocketChannel$NioSocketChannelConfig.<init>(NioSocketChannel.java:455)
at io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.java:101)
at io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.java:90)
at io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.java:83)
at io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.java:76)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at io.netty.channel.ReflectiveChannelFactory.newChannel(ReflectiveChannelFactory.java:38)
at io.netty.bootstrap.AbstractBootstrap.initAndRegister(AbstractBootstrap.java:320)
at io.netty.bootstrap.Bootstrap.doResolveAndConnect(Bootstrap.java:163)
at io.netty.bootstrap.Bootstrap.connect(Bootstrap.java:145)
我的pom依赖性是这样的
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
<version>2.1.15.RELEASE</version>
</dependency>
像这样的属性文件
spring.data.elasticsearch.cluster-name=my-application
spring.data.elasticsearch.cluster-nodes=localhost:9300
spring.data.elasticsearch.repositories.enabled=true
api.elasticsearch.uri = http://localhost:9200/
api.elasticsearch.search = /_search
暂无答案!
目前还没有任何答案,快来回答吧!