Error:(44, 45) java: cannot find symbol symbol: method settingsBuilder() location: class org.elasticsearch.common.settings.Settings

< public boolean initEStransportClinet()
{
try {
// Build the settings for our client.
String clusterId = "cd494a44d4d946ae9d84ee858cfb6cae"; // Your cluster ID here
String region = "us-east-1"; // Your region here
boolean enableSsl = true;

            Settings settings = Settings.settingsBuilder()
                .put("transport.ping_schedule", "5s")
                //.put("transport.sniff", false) // Disabled by default and *must* be disabled.
                .put("cluster.name", clusterId)
                .put("action.bulk.compress", false)
                .put("shield.transport.ssl", enableSsl)
                .put("request.headers.X-Found-Cluster", clusterId)
                .put("shield.user", "username:password") // your shield username and password
                .build();

        String hostname = clusterId + "." + region + ".aws.found.io";

// Instantiate a TransportClient and add the cluster to the list of addresses to connect to.
// Only port 9343 (SSL-encrypted) is currently supported.
Client client = TransportClient.builder()
.addPlugin(ShieldPlugin.class)
.settings(settings)
.build()
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(hostname), 9243));

I am receiving the below errors for the above mentioned code.
Kindly provide a fix for it.

Errors:

Error:(44, 45) java: cannot find symbol
symbol: method settingsBuilder()
location: class org.elasticsearch.common.settings.Settings
Error:(57, 13) java: cannot find symbol
symbol: class Client
location: class javadeveloperzone.pojo.ESDocumentIndexingMain
Error:(57, 44) java: cannot find symbol
symbol: method builder()
location: class org.elasticsearch.client.transport.TransportClient
Error:(58, 32) java: cannot find symbol
symbol: class ShieldPlugin
location: class javadeveloperzone.pojo.ESDocumentIndexingMain
Error:(61, 46) java: cannot find symbol
symbol: class InetSocketTransportAddress
location: class javadeveloperzone.pojo.ESDocumentIndexingMain

What version of Elasticsearch are you running? It looks like your transport client is a very old version. Typically the type of error you are seeing occurs when older jars get loaded with newer versions.

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