title: flink table api sink es on server has error java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.common.settings.Settings
body: <p>2022-01-04 15:58:17
  java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.common.settings.Settings
  at org.elasticsearch.action.bulk.BulkProcessor.builder(BulkProcessor.java:238)
  at org.apache.flink.streaming.connectors.elasticsearch7.Elasticsearch7ApiCallBridge.createBulkProcessorBuilder(Elasticsearch7ApiCallBridge.java:80)
  at org.apache.flink.streaming.connectors.elasticsearch7.Elasticsearch7ApiCallBridge.createBulkProcessorBuilder(Elasticsearch7ApiCallBridge.java:46)
  at org.apache.flink.streaming.connectors.elasticsearch.ElasticsearchSinkBase.buildBulkProcessor(ElasticsearchSinkBase.java:379)
  at org.apache.flink.streaming.connectors.elasticsearch.ElasticsearchSinkBase.open(ElasticsearchSinkBase.java:319)
  at org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:34)
  at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:102)
  at org.apache.flink.table.runtime.operators.sink.SinkOperator.open(SinkOperator.java:58)
  at org.apache.flink.streaming.runtime.tasks.OperatorChain.initializeStateAndOpenOperators(OperatorChain.java:442)
  at org.apache.flink.streaming.runtime.tasks.StreamTask.restoreGates(StreamTask.java:585)
  at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$1.call(StreamTaskActionExecutor.java:55)
  at org.apache.flink.streaming.runtime.tasks.StreamTask.executeRestore(StreamTask.java:565)
  at org.apache.flink.streaming.runtime.tasks.StreamTask.runWithCleanUpOnFail(StreamTask.java:650)
  at org.apache.flink.streaming.runtime.tasks.StreamTask.restore(StreamTask.java:540)
  at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:759)
  at org.apache.flink.runtime.taskmanager.Task.run(Task.java:566)
  at java.lang.Thread.run(Thread.java:748)</p>
  <p>1.1 I am aready put related jars into flink lib dir
  1.2 I am set classloader.resolve-order  parent-first
  1.3 flink version is 1.13.3
  <a href="https://i.stack.imgur.com/tNdZH.png" rel="nofollow noreferrer">the error</a></p>
  <p><a href="https://i.stack.imgur.com/P7Ntq.jpg" rel="nofollow noreferrer">add elasticsearch jars in flink lib dir</a></p>
  <p><a href="https://i.stack.imgur.com/EbKYc.png" rel="nofollow noreferrer">no errors when I  debug in intelli idea</a></p>
  <p><a href="https://i.stack.imgur.com/8agDw.png" rel="nofollow noreferrer">classloader.resolve-order  parent-first </a></p>
  <p><a href="https://i.stack.imgur.com/vkepZ.png" rel="nofollow noreferrer">with provided or without provided both has error</a>
  <a href="https://i.stack.imgur.com/OpjyI.png" rel="nofollow noreferrer">with provided or without provided both has error</a>
  <a href="https://i.stack.imgur.com/2ngTt.png" rel="nofollow noreferrer">the source at org.elasticsearch.action.bulk.BulkProcessor.builder(BulkProcessor.java:238)</a></p>