简体   繁体   English

Java9 模块错误:无法确定模块名称,未命名模块读取包和模块 org.reactivestreams 从两者读取包

[英]Java9 module error: Can not determine the module name, the unnamed module reads package and module org.reactivestreams reads package from both

I am getting 3 different errors.我收到 3 个不同的错误。

  1. Can not determine the module name ..无法确定模块名称..
  2. the unnamed module reads package..未命名的模块读取包..
  3. module org.reactivestreams reads package from both..模块 org.reactivestreams 从两者读取包..

what exactly those errors?这些错误究竟是什么?

build.gradle构建.gradle

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-webflux'
    testImplementation('org.springframework.boot:spring-boot-starter-test') {
     exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
     exclude group: 'org.mockito', module: 'mockito-core'
    }
 
    testImplementation 'io.projectreactor:reactor-test'
    testImplementation 'org.springframework.restdocs:spring-restdocs-webtestclient'
   

    compile("io.github.resilience4j:resilience4j-spring-boot2:1.3.1") {
     exclude group: 'org.mockito', module: 'mockito-core'
     }
   compile("io.github.resilience4j:resilience4j-reactor:1.3.1") {
     exclude group: 'org.mockito', module: 'mockito-core'
   }
   compile('org.springframework.boot:spring-boot-starter-aop')
   compile('org.springframework.boot:spring-boot-starter-actuator')
   compile group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
}

Error Message:错误信息:

Task :compileJava任务:编译Java

error: cannot determine module name for /Users/srihariprasad/.gradle/caches/modules-2/files-2.1/io.github.resilience4j/resilience4j-framework-common/1.3.1/8c16dda86fad3c9251930cad21ac87aa34cd8035/resilience4j-framework-common-1.3.1.jar错误:无法确定 /Users/srihariprasad/.gradle/caches/modules-2/files-2.1/io.github.resilience4j/resilience4j-framework-common/1.3.1/8c16dda86fad3c9251930cad21ac87aa5/resilience4-common 的模块名称.1.jar

error: the unnamed module reads package io.github.resilience4j.timelimiter.autoconfigure from both resilience4j.spring.boot.common and io.github.resilience4j.springboot2错误:未命名的模块从resilience4j.spring.boot.common 和io.github.resilience4j.springboot2 读取包io.github.resilience4j.timelimiter.autoconfigure

error: the unnamed module reads package io.github.resilience4j.retry.autoconfigure from both resilience4j.spring.boot.common and io.github.resilience4j.springboot2错误:未命名模块从resilience4j.spring.boot.common 和io.github.resilience4j.springboot2 读取包io.github.resilience4j.retry.autoconfigure

error: the unnamed module reads package io.github.resilience4j.ratelimiter.autoconfigure from both resilience4j.spring.boot.common and io.github.resilience4j.springboot2 error: the unnamed module reads package io.github.resilience4j.circuitbreaker.autoconfigure from both resilience4j.spring.boot.common and io.github.resilience4j.springboot2 error: the unnamed module reads package io.github.resilience4j.bulkhead.autoconfigure from both resilience4j.spring.boot.common and io.github.resilience4j.springboot2错误:未命名模块从resilience4j.spring.boot.common 和io.github.resilience4j.springboot2 读取包io.github.resilience4j.ratelimiter.autoconfigure 错误:未命名模块从io.github.resilience4j.circuitbreaker.autoconfigure 读取包弹性4j.spring.boot.common和io.github.resilience4j.springboot2错误:未命名的模块从resilience4j.spring.boot.common和io.github.resilience4j.springboot2读取包io.github.resilience4j.bulkhead.autoconfigure

error: module org.reactivestreams reads package io.github.resilience4j.timelimiter.autoconfigure from both resilience4j.spring.boot.common and io.github.resilience4j.springboot2错误:模块org.reactivestreams 从resilience4j.spring.boot.common 和io.github.resilience4j.springboot2 读取包io.github.resilience4j.timelimiter.autoconfigure

how can we find these two modules from which jar, to exclude those.我们如何从哪个 jar 中找到这两个模块,以排除它们。 1.resilience4j.spring.boot.common, 2. io.github.resilience4j.springboot2. 1.resilience4j.spring.boot.common,2.io.github.resilience4j.springboot2。 As per my understanding i need to exclude jars from resilience4j-spring-boot2:1.3.1.根据我的理解,我需要从resilience4j-spring-boot2:1.3.1中排除罐子。 But i don't understand how to do it?但我不明白该怎么做?

The packages exported by unnamed module can only be read by another unnamed module.未命名模块导出的包只能被另一个未命名模块读取。 It is not possible that a named module can read (requires) the unnamed module.命名模块不可能读取(需要)未命名模块。http://tutorials.jenkov.com/java/modules.html#unnamed-modulehttp://tutorials.jenkov.com/java/modules.html#unnamed-module

You are using Resilience4j as an automatic module, but the rule about not allowing split packages also counts for automatic modules.您使用 Resilience4j 作为自动模块,但不允许拆分包的规则也适用于自动模块。 If multiple JAR files contain (and thus exports) the same Java package, then only one of these JAR files can be used as an automatic module.如果多个 JAR 文件包含(并因此导出)相同的 Java 包,则这些 JAR 文件中只有一个可以用作自动模块。 We have to fix this split package issue in Resilience4j.我们必须在 Resilience4j 中修复这个拆分包问题。 Until then you can use the -classpath argument to the Java VM when running an application.在此之前,您可以在运行应用程序时对 Java VM 使用 -classpath 参数。 On the classpath you can include all your older Java classes, just like you have done before Java 9. All classes found on the classpath will be included in what Java calls the unnamed module.在类路径中,您可以包含所有较旧的 Java 类,就像您在 Java 9 之前所做的那样。在类路径中找到的所有类都将包含在 Java 称为未命名模块的内容中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java9中如何解决模块读取package错误 - How to resolve module reads package error in java9 未命名的模块从两者中读取 package javax.websocket - The unnamed module reads package javax.websocket from both java 9 未命名模块在调试时(使用 IntelliJ)从两者中读取包 [X] - java 9 unnamed module reads package [X] from both … while debugging (with IntelliJ) 未命名模块从 slf4j.log4j12 和 log4j 读取包 org.apache.log4j - The unnamed module reads package org.apache.log4j from both slf4j.log4j12 and log4j JavaFX 模块信息错误未命名模块从 java.validation 和 jakarta.jakartaee.api 读取包 javax.validation - JavaFX module-info error the unnamed module reads package javax.validation from both java.validation and jakarta.jakartaee.api 对Java模块的帮助:模块'name'读取包'javafx.beans' - Assistance to Java Module: Module 'name' reads package 'javafx.beans' 如何将sqlite-jdbc项目迁移到java-11; 未命名模块从 junit 和 hamcrest.core 读取包 org.hamcrest - How to migrate sqlite-jdbc project to java-11; the unnamed module reads package org.hamcrest from both junit and hamcrest.core When this error occurs Error:(1, 1) java: module JavaFX reads package java.awt from both java.desktop and java.datatransfer - When this error occurs Error:(1, 1) java: module JavaFX reads package java.awt from both java.desktop and java.datatransfer 模块从java.xml和stax.api读取包 - Module reads package from java.xml and stax.api Java 11(OpenJDK 11.0.2)+ OpenJFX 11.0.2:模块X从W和Z读取包Y - Java 11 (OpenJDK 11.0.2) + OpenJFX 11.0.2: module X reads package Y from both W and Z
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM