An error is reported when you run mysqlcdc2mysql in local mode in flink 1.18 #3167
Closed
3 tasks done
Labels
Bug
Something isn't working
Search before asking
What happened
当我使用flink1.18版本local模式调试cdc时报错:
java.lang.NoClassDefFoundError: Could not initialize class org.apache.flink.connector.jdbc.utils.JdbcTypeUtil
at org.apache.flink.connector.jdbc.converter.AbstractJdbcRowConverter.wrapIntoNullableExternalConverter(AbstractJdbcRowConverter.java:197) ~[flink-connector-jdbc-3.1.0-1.17.jar:3.1.0-1.17]
at org.apache.flink.connector.jdbc.converter.AbstractJdbcRowConverter.createNullableExternalConverter(AbstractJdbcRowConverter.java:192) ~[flink-connector-jdbc-3.1.0-1.17.jar:3.1.0-1.17]
at org.apache.flink.connector.jdbc.converter.AbstractJdbcRowConverter.(AbstractJdbcRowConverter.java:69) ~[flink-connector-jdbc-3.1.0-1.17.jar:3.1.0-1.17]
at org.apache.flink.connector.jdbc.internal.converter.MySQLRowConverter.(MySQLRowConverter.java:38) ~[flink-connector-jdbc-3.1.0-1.17.jar:3.1.0-1.17]
at org.apache.flink.connector.jdbc.dialect.mysql.MySqlDialect.getRowConverter(MySqlDialect.java:56) ~[flink-connector-jdbc-3.1.0-1.17.jar:3.1.0-1.17]
at org.apache.flink.connector.jdbc.table.JdbcOutputFormatBuilder.createSimpleRowExecutor(JdbcOutputFormatBuilder.java:211) ~[flink-connector-jdbc-3.1.0-1.17.jar:3.1.0-1.17]
at org.apache.flink.connector.jdbc.table.JdbcOutputFormatBuilder.lambda$createUpsertRowExecutor$3(JdbcOutputFormatBuilder.java:190) ~[flink-connector-jdbc-3.1.0-1.17.jar:3.1.0-1.17]
at java.util.Optional.map(Optional.java:215) ~[?:1.8.0_333]
at org.apache.flink.connector.jdbc.table.JdbcOutputFormatBuilder.createUpsertRowExecutor(JdbcOutputFormatBuilder.java:190) ~[flink-connector-jdbc-3.1.0-1.17.jar:3.1.0-1.17]
at org.apache.flink.connector.jdbc.table.JdbcOutputFormatBuilder.createBufferReduceExecutor(JdbcOutputFormatBuilder.java:152) ~[flink-connector-jdbc-3.1.0-1.17.jar:3.1.0-1.17]
at org.apache.flink.connector.jdbc.table.JdbcOutputFormatBuilder.lambda$build$d2919689$1(JdbcOutputFormatBuilder.java:104) ~[flink-connector-jdbc-3.1.0-1.17.jar:3.1.0-1.17]
at org.apache.flink.connector.jdbc.internal.JdbcOutputFormat.createAndOpenStatementExecutor(JdbcOutputFormat.java:170) ~[flink-connector-jdbc-3.1.0-1.17.jar:3.1.0-1.17]
at org.apache.flink.connector.jdbc.internal.JdbcOutputFormat.open(JdbcOutputFormat.java:144) ~[flink-connector-jdbc-3.1.0-1.17.jar:3.1.0-1.17]
at org.apache.flink.connector.jdbc.internal.GenericJdbcSinkFunction.open(GenericJdbcSinkFunction.java:52) ~[flink-connector-jdbc-3.1.0-1.17.jar:3.1.0-1.17]
at org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:34) ~[flink-core-1.18.0.jar:1.18.0]
at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:101) ~[flink-streaming-java-1.18.0.jar:1.18.0]
at org.apache.flink.table.runtime.operators.sink.SinkOperator.open(SinkOperator.java:58) ~[flink-table-runtime-1.18.0.jar:1.18.0]
at org.apache.flink.streaming.runtime.tasks.RegularOperatorChain.initializeStateAndOpenOperators(RegularOperatorChain.java:107) ~[flink-streaming-java-1.18.0.jar:1.18.0]
at org.apache.flink.streaming.runtime.tasks.StreamTask.restoreGates(StreamTask.java:753) ~[flink-streaming-java-1.18.0.jar:1.18.0]
at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$1.call(StreamTaskActionExecutor.java:55) ~[flink-streaming-java-1.18.0.jar:1.18.0]
at org.apache.flink.streaming.runtime.tasks.StreamTask.restoreInternal(StreamTask.java:728) ~[flink-streaming-java-1.18.0.jar:1.18.0]
at org.apache.flink.streaming.runtime.tasks.StreamTask.restore(StreamTask.java:693) ~[flink-streaming-java-1.18.0.jar:1.18.0]
at org.apache.flink.runtime.taskmanager.Task.runWithSystemExitMonitoring(Task.java:953) ~[flink-runtime-1.18.0.jar:1.18.0]
at org.apache.flink.runtime.taskmanager.Task.restoreAndInvoke(Task.java:922) ~[flink-runtime-1.18.0.jar:1.18.0]
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:746) ~[flink-runtime-1.18.0.jar:1.18.0]
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:562) ~[flink-runtime-1.18.0.jar:1.18.0]
at java.lang.Thread.run(Thread.java:750) ~[?:1.8.0_333]
原因大概是flink-connector-jdbc3.1.0-1.17版本的JdbcTypeUtil类依赖的shaded.guava版本和当前flink1.18pom文件内的shaded.guava版本对不齐路径
尝试更新flink-connector-jdbc版本到3.1.1-1.17可以解决
What you expected to happen
正常执行mysqlcdc2mysql
How to reproduce
本地调试dinky使用local模式运行mysqlcdc2mysql
Anything else
No response
Version
dev
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: