Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provider org.apache.seatunnel.connectors.seatunnel.jdbc.sink.JdbcSink could not be instantiated #5801

Closed
1 of 3 tasks
righBai opened this issue Nov 7, 2023 · 2 comments · Fixed by #6551
Closed
1 of 3 tasks
Labels
bug Waiting for users feedback Waiting for feedback from issue/PR author

Comments

@righBai
Copy link

righBai commented Nov 7, 2023

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

需要将pg数据库中的数据传输到hdfs中,相同的配置文件在IDEA中可以正常运行,当代码编译打包后,提交到服务器中,除了pg到hdfs运行会出现异常,其它可以正常运行,如:hdfs到pg、pg到pg、pg到Doris等。

SeaTunnel Version

dev版本

SeaTunnel Config

env {
    execution.parallelism = 1
    job.mode = "BATCH"
}

source {
    Jdbc {
        url = "jdbc:postgresql://192.168.10.216:5432/selection"
        driver = "org.postgresql.Driver"
        connection_check_timeout_sec = 100
        user = "xxx"
        password = "xxx"
        query = "select * from public.us_all_syn_st_2023_34 limit 10000"
    }
}

transform {

}

sink {
    HdfsFile {
      fs.defaultFS = "hdfs://hadoop15:8020"
      path = "/user/root/test4"
      file_format = "text"
    }
}

Running Command

sh /opt/module/seatunnel/bin/seatunnel.sh --config /home/xxx/conf/selection.conf -e local

Error Exception

Exception in thread "main" java.util.ServiceConfigurationError: org.apache.seatunnel.api.sink.SeaTunnelSink: Provider org.apache.seatunnel.connectors.seatunnel.jdbc.sink.JdbcSink could not be instantiated
        at java.util.ServiceLoader.fail(ServiceLoader.java:232)
        at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
        at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
        at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
        at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
        at org.apache.seatunnel.plugin.discovery.AbstractPluginDiscovery.loadPluginInstance(AbstractPluginDiscovery.java:302)
        at org.apache.seatunnel.plugin.discovery.AbstractPluginDiscovery.createOptionalPluginInstance(AbstractPluginDiscovery.java:183)
        at org.apache.seatunnel.plugin.discovery.AbstractPluginDiscovery.createPluginInstance(AbstractPluginDiscovery.java:227)
        at org.apache.seatunnel.engine.core.parse.ConnectorInstanceLoader.loadSinkInstance(ConnectorInstanceLoader.java:77)
        at org.apache.seatunnel.engine.core.parse.JobConfigParser.parseSink(JobConfigParser.java:198)
        at org.apache.seatunnel.engine.core.parse.JobConfigParser.parseSinks(JobConfigParser.java:174)
        at org.apache.seatunnel.engine.core.parse.MultipleTableJobConfigParser.parseSink(MultipleTableJobConfigParser.java:528)
        at org.apache.seatunnel.engine.core.parse.MultipleTableJobConfigParser.parse(MultipleTableJobConfigParser.java:190)
        at org.apache.seatunnel.engine.client.job.ClientJobExecutionEnvironment.getLogicalDag(ClientJobExecutionEnvironment.java:88)
        at org.apache.seatunnel.engine.client.job.ClientJobExecutionEnvironment.execute(ClientJobExecutionEnvironment.java:161)
        at org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand.execute(ClientExecuteCommand.java:144)
        at org.apache.seatunnel.core.starter.SeaTunnel.run(SeaTunnel.java:40)
        at org.apache.seatunnel.core.starter.seatunnel.SeaTunnelClient.main(SeaTunnelClient.java:34)
Caused by: java.lang.InstantiationException: org.apache.seatunnel.connectors.seatunnel.jdbc.sink.JdbcSink
        at java.lang.Class.newInstance(Class.java:427)
        at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
        ... 15 more
Caused by: java.lang.NoSuchMethodException: org.apache.seatunnel.connectors.seatunnel.jdbc.sink.JdbcSink.<init>()
        at java.lang.Class.getConstructor0(Class.java:3082)
        at java.lang.Class.newInstance(Class.java:412)
        ... 16 more

Zeta or Flink or Spark Version

2.3.4

Java or Scala Version

jdk1.8

Screenshots

image

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@righBai righBai added the bug label Nov 7, 2023
@Carl-Zhou-CN
Copy link
Member

hi, @righBai I feel that the configuration does not match the exception. Can you check the configuration file again? Why does jdbc sink appear

@Carl-Zhou-CN Carl-Zhou-CN added the Waiting for users feedback Waiting for feedback from issue/PR author label Nov 28, 2023
@WuJiY
Copy link

WuJiY commented Mar 11, 2024

同样 我也是dev版本 iceberg -> clickhouse 报错

env {
    job.mode="BATCH"
    parallelism=1
}

source {
 Iceberg {
    schema {
      fields {
        age = "int"
        name = "string"
        email = "string"
      }
    }
    catalog_name = "iceberg"
    iceberg.catalog.config={
      type = "hadoop"
      warehouse = "hdfs://master/iceberg/"
    }
    namespace = "db"
    table = "my_table"
  }
}
sink {
   Clickhouse {
      host="localhost:8123"
      database="st"
      table="iceberg"
      username="default"
      password="123456"
      allowExperimentalLightweightDelete=true
   }
}

报错信息
Exception in thread "main" java.util.ServiceConfigurationError: org.apache.seatunnel.api.sink.SeaTunnelSink: Provider org.apache.seatunnel.connectors.seatunnel.iceberg.sink.IcebergSink could not be instantiated

另外
pg->clickhouse 正常
iceberg->pg也是正常

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Waiting for users feedback Waiting for feedback from issue/PR author
Projects
None yet
3 participants