← All tasks
javaDTStack/chunjun #1627Not a task: not reproduced

[Bug] [mysql] 依赖问题

envgap__DTStack__chunjun-1627

01 / FAILURE SIGNATURE

As reported upstream

Caused by: org.apache.flink.table.api.ValidationException: Could not find any factory for identifier 'mysql-x' that implements 'org.apache.flink.table.factories.DynamicTableFactory' in the classpath.
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
6d61075b2fa1027d90b6b514be803ca96b087b30
Manifest
chunjun-connectors/chunjun-connector-mysql/pom.xml
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

DTStack/chunjun #1627 · read the original issue
### Search before asking

- [X] I had searched in the [issues](https://github.com/DTStack/chunjun/issues) and found no similar issues.


### What happened

当执行在linux 环境下执行yarn-per-job sql任务时,报依赖找不到相关问题



```



Caused by: org.apache.flink.table.api.ValidationException: Cannot discover a connector using option: 'connector'='mysql-x'

	at org.apache.flink.table.factories.FactoryUtil.enrichNoMatchingConnectorError(FactoryUtil.java:735)

	at org.apache.flink.table.factories.FactoryUtil.discoverTableFactory(FactoryUtil.java:709)

	at org.apache.flink.table.factories.FactoryUtil.createDynamicTableSource(FactoryUtil.java:162)

	... 58 more

Caused by: org.apache.flink.table.api.ValidationException: Could not find any factory for identifier 'mysql-x' that implements 'org.apache.flink.table.factories.DynamicTableFactory' in the classpath.



```





```

Caused by: java.lang.NoClassDefFoundError: io/vertx/ext/jdbc/spi/DataSourceProvider

	at java.lang.ClassLoader.defineClass1(Native Method)

	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)

	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)

	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)

	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)

	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)

	at java.security.AccessController.doPrivileged(Native Method)

	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)

	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

	at com.dtstack.chunjun.connector.jdbc.options.JdbcLookupOptions.<clinit>(JdbcLookupOptions.java:88)

	at com.dtstack.chunjun.connector.jdbc.table.JdbcDynamicTableFactory.createDynamicTableSource(JdbcDynamicTableFactory.java:120)

	at org.apache.flink.table.factories.FactoryUtil.createDynamicTableSource(FactoryUtil.java:163)

	... 58 more

Caused by: java.lang.ClassNotFoundException: io.vertx.ext.jdbc.spi.DataSourceProvider

	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

```

### What you expected to happen

可以正常运行mysql读写

### How to reproduce



```



CREATE TABLE source

(

    username varchar,

    age          int

) WITH (

      'connector' = 'stream-x',

      'number-of-rows' = '1'

);



CREATE TABLE sink

(

    username varchar,

    age          int

) WITH (



      'connector' = 'mysql-x',

      'url' = 'jdbc:mysql://ip:port/flinkx_test?useUnicode=true&characterEncoding=utf8&useSSL=false',

      'table-name' = 'flinkx_dm8_test',

      'username' = 'user',

      'password' = 'pwd',

      'sink.buffer-flush.max-rows' = '1024',

      'sink.buffer-flush.interval' = '1000',

      'sink.all-replace' = 'false',

      'sink.parallelism' = '1'

      ,'sink.pre-sql' = 'delete from flinkx_dm8_test where id>4 and id < 120'

      ,'sink.post-sql' = 'update flinkx_dm8_test set username=''李四-7'' where id=4'

      );



insert into sink select * from source;





```









### Anything else

_No response_

### Version

master

### Are you willing to submit PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]