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

An error is reported when you run mysqlcdc2mysql in local mode in flink 1.18 #3167

Closed
3 tasks done
yangzehan opened this issue Feb 21, 2024 · 2 comments
Closed
3 tasks done
Assignees
Labels
Bug Something isn't working

Comments

@yangzehan
Copy link
Contributor

Search before asking

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

What happened

image
当我使用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版本对不齐路径
image
尝试更新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?

  • Yes I am willing to submit a PR!

Code of Conduct

@yangzehan yangzehan added Bug Something isn't working Waiting for reply Waiting for reply labels Feb 21, 2024
Copy link

Hello @yangzehan, this issue is about CDC/CDCSOURCE, so I assign it to @aiwenmo. If you have any questions, you can comment and reply.

你好 @yangzehan, 这个 issue 是关于 CDC/CDCSOURCE 的,所以我把它分配给了 @aiwenmo。如有任何问题,可以评论回复。

@Zzm0809
Copy link
Contributor

Zzm0809 commented Feb 26, 2024

@yangzehan 请规范你的 issue title, 否则将视为无效 issue

@Zzm0809 Zzm0809 removed the Waiting for reply Waiting for reply label Feb 26, 2024
@Zzm0809 Zzm0809 closed this as completed Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants