尝试使用命令启动kafka-connect时遇到很多异常:
./bin/connect-distributed ./etc/schema-registry/connect-avro-distributed.properties
对于share / java目录中的每一个jar(至少),我得到这样的异常,抱怨错误的幻数:
[2018-01-30 08:10:47,804] DEBUG could not scan file META-INF/MANIFEST.MF in url file:/opt/confluent/confluent-4.0.0/./bin/../share/java/kafka/javassist-3.21.0-GA.jar with scanner SubTypesScanner (org.reflections.Reflections:257)
org.reflections.ReflectionsException: could not create class object from file META-INF/MANIFEST.MF
at org.reflections.scanners.AbstractScanner.scan(AbstractScanner.java:32)
at org.reflections.Reflections.scan(Reflections.java:253)
at org.reflections.Reflections.scan(Reflections.java:202)
at org.reflections.Reflections.<init>(Reflections.java:123)
at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanPluginPath(DelegatingClassLoader.java:258)
at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanUrlsAndAddPlugins(DelegatingClassLoader.java:201)
at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initLoaders(DelegatingClassLoader.java:162)
at org.apache.kafka.connect.runtime.isolation.Plugins.<init>(Plugins.java:47)
at org.apache.kafka.connect.cli.ConnectDistributed.main(ConnectDistributed.java:70)
Caused by: org.reflections.ReflectionsException: could not create class file from MANIFEST.MF
at org.reflections.adapters.JavassistAdapter.getOfCreateClassObject(JavassistAdapter.java:102)
at org.reflections.adapters.JavassistAdapter.getOfCreateClassObject(JavassistAdapter.java:24)
at org.reflections.scanners.AbstractScanner.scan(AbstractScanner.java:30)
... 8 more
Caused by: java.io.IOException: bad magic number: 4d616e69
at javassist.bytecode.ClassFile.read(ClassFile.java:825)
at javassist.bytecode.ClassFile.<init>(ClassFile.java:154)
at org.reflections.adapters.JavassistAdapter.getOfCreateClassObject(JavassistAdapter.java:100)
... 10 more
我在'./etc/schema-registry/connect-avro-distributed.properties'文件中配置了插件目录的完整路径。
我正在使用Confluent oss 4.0.0-2.11在Ubuntu Server 16.04上运行,并尝试了Oracle的JDK和JRE v1.8.0_162以及v9.0.4和OpenJDK8,结果完全相同。然而,奇怪的是,在Ubuntu Desktop 16.04上完全相同的版本开始顺利。我甚至试图将所有“share / java”目录内容从正在工作的机器上复制到(不重新创建某些文件夹中的符号链接),但它没有任何区别。
在同一台服务器上,我可以毫无问题地启动kafka-server和架构注册表。
此外,从Confluent v3.3.0安装运行相同的命令可以完美运行。所以,我尝试在confluent-4.0.0的'./etc/schema-registry/connect-avro-distributed.properties'文件中配置plugin.path变量,以指向汇合中的'share / java'目录-3.3.0安装。但是从confluent-4.0.0文件夹中指向confluent-3.3.0'share / java'目录运行命令会产生完全相同的异常链。
任何可能出错的线索?因为我的想法已经不多了......
谢谢!