由于错误而停止时出错(org.apache.kafka.connect.cli.connectstandalone)java.lang.noclassdeffounderror:io/debezium/util/ioutil

daupos2t  于 2021-06-04  发布在  Kafka
关注(0)|答案(3)|浏览(480)

我正在尝试将我的sql server数据库连接到windows上的kafka,我下载了debezium jar文件,它们位于一个名为debezium connector sql server的文件夹中,下面是它的样子:kafka文件夹,debezium文件夹
我还加了这句话 plugin.path=C:\\current_kafka_2.12-2.0.0\\debezium-connector-sqlserver 在connect-standalone.properties中,我将从debezium下载的所有jar文件放在这里。
我还创建了一个名为connect-mssql.properties的文件,并将其放入其中。

name=inventory-connector
connector.class=io.debezium.connector.sqlserver.SqlServerConnector
tasks.max=2
database.hostname=DESKTOP-LMJGRO0
database.port=1433
database.user=sa
database.password=password
database.dbname=Source
database.history.kafka.bootstrap.servers=localhost:9092
database.history.kafka.topic=test
table.whitelist=dbo.guinea_pig_source

现在,当我尝试运行此操作时。\bin\windows\connect standalone.\config\connect-standalone.properties.\config\connect-mssql.properties
我得到以下错误:

[2019-02-20 17:18:39,794] ERROR Stopping due to error (org.apache.kafka.connect.cli.ConnectStandalone)
java.lang.NoClassDefFoundError: io/debezium/util/IoUtil
        at io.debezium.connector.sqlserver.Module.<clinit>(Module.java:19)
        at io.debezium.connector.sqlserver.SqlServerConnector.version(SqlServerConnector.java:29)
        at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.versionFor(DelegatingClassLoader.java:346)
        at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.versionFor(DelegatingClassLoader.java:351)
        at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.getPluginDesc(DelegatingClassLoader.java:328)
        at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanPluginPath(DelegatingClassLoader.java:309)
        at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanUrlsAndAddPlugins(DelegatingClassLoader.java:240)
        at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.registerPlugin(DelegatingClassLoader.java:232)
        at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initPluginLoader(DelegatingClassLoader.java:201)
        at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initLoaders(DelegatingClassLoader.java:178)
        at org.apache.kafka.connect.runtime.isolation.Plugins.<init>(Plugins.java:61)
        at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:77)
Caused by: java.lang.ClassNotFoundException: io.debezium.util.IoUtil
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at org.apache.kafka.connect.runtime.isolation.PluginClassLoader.loadClass(PluginClassLoader.java:104)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 12 more
w80xi6nr

w80xi6nr1#

所有插件文件必须位于“plugin.path=”的子目录中。例如,如果插件路径为:

plugin.path=F:/connect-plugins/

使用以下文件创建目录f:/connect plugins/mssql debezium:
debezium-connector-sqlserver-0.9.2.final.jar
debezium-core-0.9.2.final.jar文件
mssql-jdbc-6.4.0.jre8.jar

vngu2lb8

vngu2lb82#

尝试将“debezium connector sqlserver”嵌套在另一个文件夹中,例如:“plugins”,并将connect-standalone.properties更新为plugin.path=c:\current\u kafka\u 2.12-2.0.0\plugins
因此,您的目录结构将类似于c:\current\u kafka\u 2.12-2.0.0\plugins\debezium connector sqlserver,您的jar将位于“debezium connector sqlserver”中

vkc1a9a2

vkc1a9a23#

将连接器jar文件和kafka库文件添加到类路径:
在linux中:export classpath=$classpath:/debezium connector sqlserver/*
导出类路径=$classpath://kafka/libs/*

相关问题