使用spring-kafka收听kafka主题时出现UnsatisfiedLinkError

时间:2019-12-07 15:43:50

标签: java spring-boot apache-kafka spring-kafka snappy

通过我编写的Kafka-Consumer应用程序收听kafka主题时,我遇到了错误。不知道这是我的系统还是项目问题。我看到snappy被捆绑为spring项目本身的一部分,因此我的系统不应有问题。 任何帮助将不胜感激。

  • Spring Boot:2.1.7
  • 春季卡夫卡:2.3.0
  • JDK:11.0.4
  • 项目构建系统:OS X,Intellij Idea 2019.02
  

2019-12-07 21:01:12.740停止容器时出错:   java.lang.UnsatisfiedLinkError:/private/var/folders/t9/mdy_gddj7yq4l13675rs22rx96jqs9/T/snappy-1.1.7-1ce9dfaf-b4ec-41ba-8a64-a52a9ed6e6c9-libsnappy/var/open/dl/open/ mdy_gddj7yq4l13675rs22rx96jqs9 / T / snappy-1.1.7-1ce9dfaf-b4ec-41ba-8a64-a52a9ed6e6c9-libsnappyjava.jnilib,1):未找到合适的图像。确实找到了:       /private/var/folders/t9/mdy_gddj7yq4l13675rs22rx96jqs9/T/snappy-1.1.7-1ce9dfaf-b4ec-41ba-8a64-a52a9ed6e6c9-libsnappyjava.jnilib:代码签入( snappy-1.1.7-1ce9dfaf-b4ec-41ba-8a64-a52a9ed6e6c9-libsnappyjava.jnilib)在使用库验证的过程中无效:映射文件没有cdhash,完全未签名?代码必须至少是临时签名的。       在java.base / java.lang.ClassLoader $ NativeLibrary.load0(本机方法)       在java.base / java.lang.ClassLoader $ NativeLibrary.load(ClassLoader.java:2430)       在java.base / java.lang.ClassLoader $ NativeLibrary.loadLibrary(ClassLoader.java:2487)       在java.base / java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2684)       在java.base / java.lang.ClassLoader.loadLibrary(ClassLoader.java:2617)       在java.base / java.lang.Runtime.load0(Runtime.java:767)       在java.base / java.lang.System.load(System.java:1831)       在org.xerial.snappy.SnappyLoader.loadNativeLibrary(SnappyLoader.java:179)       在org.xerial.snappy.SnappyLoader.loadSnappyApi(SnappyLoader.java:154)       在org.xerial.snappy.Snappy(Snappy.java:47)       在org.xerial.snappy.SnappyInputStream.hasNextChunk(SnappyInputStream.java:435)       在org.xerial.snappy.SnappyInputStream.read(SnappyInputStream.java:466)       在java.base / java.io.DataInputStream.readByte(DataInputStream.java:270)       在org.apache.kafka.common.utils.ByteUtils.readVarint(ByteUtils.java:168)       在org.apache.kafka.common.record.DefaultRecord.readFrom(DefaultRecord.java:293)       在org.apache.kafka.common.record.DefaultRecordBatch $ 1.readNext(DefaultRecordBatch.java:264)       在org.apache.kafka.common.record.DefaultRecordBatch $ RecordIterator.next(DefaultRecordBatch.java:569)       在org.apache.kafka.common.record.DefaultRecordBatch $ RecordIterator.next(DefaultRecordBatch.java:538)       在org.apache.kafka.clients.consumer.internals.Fetcher $ PartitionRecords.nextFetchedRecord(Fetcher.java:1452)       在org.apache.kafka.clients.consumer.internals.Fetcher $ PartitionRecords.fetchRecords(Fetcher.java:1487)       在org.apache.kafka.clients.consumer.internals.Fetcher $ PartitionRecords.access $ 1600(Fetcher.java:1332)       在org.apache.kafka.clients.consumer.internals.Fetcher.fetchRecords(Fetcher.java:645)       在org.apache.kafka.clients.consumer.internals.Fetcher.fetchedRecords(Fetcher.java:606)       在org.apache.kafka.clients.consumer.KafkaConsumer.pollForFetches(KafkaConsumer.java:1294)       在org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:1225)       在org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:1201)       在org.springframework.kafka.listener.KafkaMessageListenerContainer $ ListenerConsumer.doPoll(KafkaMessageListenerContainer.java:993)       在org.springframework.kafka.listener.KafkaMessageListenerContainer $ ListenerConsumer.pollAndInvoke(KafkaMessageListenerContainer.java:949)处       在org.springframework.kafka.listener.KafkaMessageListenerContainer $ ListenerConsumer.run(KafkaMessageListenerContainer.java:901)       在java.base / java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:515)       在java.base / java.util.concurrent.FutureTask.run $$$ capture(FutureTask.java:264)       在java.base / java.util.concurrent.FutureTask.run(FutureTask.java)       在java.base / java.lang.Thread.run(Thread.java:834)

我的项目gradle配置:


dependencies {
    ***
    compile "org.springframework.boot:spring-boot-starter-actuator:2.1.7.RELEASE"
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.1.7.RELEASE'
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-logging', version: '2.1.7.RELEASE'
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: '2.1.7.RELEASE'
    compile group: 'org.springframework.kafka', name: 'spring-kafka', version: '2.3.4.RELEASE'***

    compile group: 'org.postgresql', name: 'postgresql', version: '9.4.1212.jre7'
    compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.1'
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.10.0'
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.10.0'
    compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.10.0'
    compile group: 'io.micrometer', name: 'micrometer-registry-prometheus', version: '1.3.0'

    testCompile "org.springframework.boot:spring-boot-starter-test:2.1.7.RELEASE"
    testCompile group: 'org.springframework.kafka', name: 'spring-kafka-test', version: '2.3.4.RELEASE'
    testCompile group: 'com.h2database', name: 'h2', version: '1.4.200'
    testCompile group: 'org.awaitility', name: 'awaitility', version: '4.0.1'
}
  

更新:

     

我从this帖子中得到了提示,并将Open-JDK更新为    11.0.4 中的 11.0.5 。现在,我不再看到该问题。

     

谢谢。

0 个答案:

没有答案