Unexpected Error in Scheduled Task

Hello. I am running a setup using elasticsearch 5.5.3. We've just migrated from a different server using 2.3.4 and are in the process of getting everything finalized. During this I encountered a parsing error (non-related to the current issue) that had me go to the git and pull a previous version since I couldnt pinpoint the issue.

We're running everything as localhost on our server, including our java application which is deployed as a war file in tomcat. When I'm running the "freshly" pulled JAR file, I produce this error:

2018-07-27 10:56:00.722 ERROR 103481 --- [pool-2-thread-1] o.s.s.s.TaskUtils$LoggingErrorHandler    : Unexpected error occurred in scheduled task.

java.lang.AbstractMethodError: org.elasticsearch.transport.TcpTransport.connectToChannels(Lorg/elasticsearch/cluster/node/DiscoveryNode;Lorg/elasticsearch/transport/ConnectionProfile;Ljava/util/function/Consumer;)Lorg/elasticsearch/transport/TcpTransport$NodeChannels;
        at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:548) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:116) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.transport.TransportService.openConnection(TransportService.java:351) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.client.transport.TransportClientNodesService$SimpleNodeSampler.doSample(TransportClientNodesService.java:407) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.client.transport.TransportClientNodesService$NodeSampler.sample(TransportClientNodesService.java:357) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.client.transport.TransportClientNodesService.addTransportAddresses(TransportClientNodesService.java:198) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.client.transport.TransportClient.addTransportAddress(TransportClient.java:319) ~[elasticsearch-5.5.3.jar:5.5.3]
        at jbv.ertms.logger.dao.ElasticConnector.<init>(ElasticConnector.java:47) ~[classes/:0.0.1-SNAPSHOT]
        at jbv.ertms.logger.configuration.LoggerContext.getJSONObject(LoggerContext.java:106) ~[classes/:0.0.1-SNAPSHOT]
        at jbv.ertms.logger.configuration.LoggerContext.lambda$execute$4(LoggerContext.java:231) ~[classes/:0.0.1-SNAPSHOT]
        at java.util.HashMap.forEach(HashMap.java:1289) ~[na:1.8.0_171]
        at jbv.ertms.logger.configuration.LoggerContext.execute(LoggerContext.java:227) ~[classes/:0.0.1-SNAPSHOT]
        at jbv.ertms.logger.service.ScheduleManager.reportObjects(ScheduleManager.java:42) ~[classes/:0.0.1-SNAPSHOT]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_171]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_171]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
        at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
        at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
        at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) [spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_171]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_171]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_171]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_171]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_171]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_171]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_171]

While if I run the 'old' code, it runs fine and inserts into elasticsearch but the parsing error persists, so the data inserted is worthless. The error as seen points to the connection to elasticsearch, code for that is below. I've tried defining the client as both general client and directly as TransportClient.

			Settings settings = Settings.builder()
					.put("cluster.name", "ertmslog")
					.build();
			this.client = new PreBuiltTransportClient(settings)
					.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(Constant.Elasticsearch_ADDRESS), Constant.Elasticsearch_PORT));
			this.index = index;
			this.type = type;

Lastly, heres some other things I've checked. Both have the same ports, cluster name, and pom.xml.

And a more descriptive flow of what I did until this problem occured:

Try to get "old" code to test it. Create indice for it. Noticed the logs aren't parsed correctly. Stop tomcat, delete indice, pull fresh version from git, change dependencies, create indice, start tomcat and error occured.

Thanks for your time spent helping me out.

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