An attempt was made to call a method that does not exist. The attempt was made from the following lo

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.elasticsearch.transport.netty4.Netty4InternalESLogger.(Netty4InternalESLogger.java:34)

The following method did not exist:

    org.elasticsearch.common.logging.Loggers.getLogger(Ljava/lang/String;)Lorg/apache/logging/log4j/Logger;

The method's class, org.elasticsearch.common.logging.Loggers, is available from the following locations:

    jar:file:/Users/admin/.m2/repository/org/elasticsearch/elasticsearch/6.8.4/elasticsearch-6.8.4.jar!/org/elasticsearch/common/logging/Loggers.class

It was loaded from the following location:

    file:/Users/admin/.m2/repository/org/elasticsearch/elasticsearch/6.8.4/elasticsearch-6.8.4.jar

原因是因为版本不对 全部es的版本要对应上 下面是maven依赖就可以了

        
            org.elasticsearch
            elasticsearch
            6.8.4
        
        
            org.elasticsearch.client
            transport
            6.8.4
            
                
                    org.elasticsearch
                    elasticsearch
                
            
        
        
            org.elasticsearch.plugin
            transport-netty4-client
            6.8.4
        

你可能感兴趣的:(java)