包 'javax.jms' 在具有无效名称的模块中声明 ('geronimo.jms.2.0.spec')

如何解决包 'javax.jms' 在具有无效名称的模块中声明 ('geronimo.jms.2.0.spec')

此时我正在重构一个应用程序以使用 java 的模块化系统和 我在使用 org.apache.activemq:artemis-jms-client:jar:2.16.0:compile 时遇到了尴尬的情况。我收到一个错误

Package 'javax.jms' is declared in module with an invalid name ('geronimo.jms.2.0.spec') 

在使用模块时有什么办法可以绕过这个错误吗?

注意:我使用的是 JAVA 11;马文; IntelliJ IDEA 2020.3.1(社区版)

mvn 依赖:树

[INFO] +- org.springframework.boot:spring-boot-starter:jar:2.4.0:compile
[INFO] |  +- org.springframework.boot:spring-boot:jar:2.4.0:compile
[INFO] |  |  \- org.springframework:spring-context:jar:5.3.1:compile
[INFO] |  +- org.springframework.boot:spring-boot-autoconfigure:jar:2.4.0:compile
[INFO] |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  +- org.springframework:spring-core:jar:5.3.1:compile
[INFO] |  |  \- org.springframework:spring-jcl:jar:5.3.1:compile
[INFO] |  \- org.yaml:snakeyaml:jar:1.27:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.4.0:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-json:jar:2.4.0:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.11.3:compile
[INFO] |  |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.11.3:compile
[INFO] |  |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.11.3:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.11.3:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.11.3:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.11.3:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.4.0:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.39:compile
[INFO] |  |  +- org.glassfish:jakarta.el:jar:3.0.3:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.39:compile
[INFO] |  +- org.springframework:spring-web:jar:5.3.1:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:5.3.1:compile
[INFO] |     +- org.springframework:spring-aop:jar:5.3.1:compile
[INFO] |     \- org.springframework:spring-expression:jar:5.3.1:compile
[INFO] +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile
[INFO] |  \- jakarta.activation:jakarta.activation-api:jar:1.2.2:compile
[INFO] +- com.sun.xml.bind:jaxb-impl:jar:2.3.3:runtime
[INFO] |  \- com.sun.activation:jakarta.activation:jar:1.2.2:compile
[INFO] +- jakarta.xml.ws:jakarta.xml.ws-api:jar:2.3.3:compile
[INFO] |  +- jakarta.xml.soap:jakarta.xml.soap-api:jar:1.4.2:compile
[INFO] |  \- jakarta.jws:jakarta.jws-api:jar:2.1.0:compile
[INFO] +- com.sun.xml.ws:jaxws-rt:jar:2.3.3:compile
[INFO] |  +- com.sun.xml.ws:policy:jar:2.7.10:compile
[INFO] |  +- org.glassfish.ha:ha-api:jar:3.1.12:compile
[INFO] |  +- org.glassfish.external:management-api:jar:3.2.2:compile
[INFO] |  +- org.glassfish.gmbal:gmbal:jar:4.0.1:compile
[INFO] |  +- org.glassfish.pfl:pfl-tf:jar:4.1.0:compile
[INFO] |  +- org.glassfish.pfl:pfl-basic:jar:4.1.0:compile
[INFO] |  +- org.jvnet.staxex:stax-ex:jar:1.8.3:compile
[INFO] |  +- com.sun.xml.stream.buffer:streambuffer:jar:1.5.9:compile
[INFO] |  +- org.jvnet.mimepull:mimepull:jar:1.9.13:compile
[INFO] |  +- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.18:compile
[INFO] |  +- com.sun.xml.messaging.saaj:saaj-impl:jar:1.5.2:compile
[INFO] |  +- com.fasterxml.woodstox:woodstox-core:jar:5.1.0:compile
[INFO] |  \- org.codehaus.woodstox:stax2-api:jar:4.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-artemis:jar:2.4.0:compile
[INFO] |  +- jakarta.jms:jakarta.jms-api:jar:2.0.3:compile
[INFO] |  +- jakarta.json:jakarta.json-api:jar:1.1.6:compile
[INFO] |  \- org.springframework:spring-jms:jar:5.3.1:compile
[INFO] |     +- org.springframework:spring-messaging:jar:5.3.1:compile
[INFO] |     \- org.springframework:spring-tx:jar:5.3.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.4.0:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:2.4.0:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.4.0:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] |  |  \- net.minidev:json-smart:jar:2.3:test
[INFO] |  |     \- net.minidev:accessors-smart:jar:1.2:test
[INFO] |  +- org.assertj:assertj-core:jar:3.18.1:test
[INFO] |  +- org.hamcrest:hamcrest:jar:2.2:test
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.7.0:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-api:jar:5.7.0:test
[INFO] |  |  |  +- org.apiguardian:apiguardian-api:jar:1.1.0:test
[INFO] |  |  |  +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] |  |  |  \- org.junit.platform:junit-platform-commons:jar:1.7.0:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.7.0:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.7.0:test
[INFO] |  |     \- org.junit.platform:junit-platform-engine:jar:1.7.0:test
[INFO] |  +- org.mockito:mockito-core:jar:3.6.0:test
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.10.18:test
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.10.18:test
[INFO] |  |  \- org.objenesis:objenesis:jar:3.1:test
[INFO] |  +- org.mockito:mockito-junit-jupiter:jar:3.6.0:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] |  +- org.springframework:spring-test:jar:5.3.1:test
[INFO] |  \- org.xmlunit:xmlunit-core:jar:2.7.0:test
[INFO] +- org.apache.cxf:cxf-rt-features-logging:jar:3.3.1:compile
[INFO] |  +- org.apache.cxf:cxf-core:jar:3.3.1:compile
[INFO] |  |  +- org.glassfish.jaxb:jaxb-runtime:jar:2.3.3:compile
[INFO] |  |  |  +- org.glassfish.jaxb:txw2:jar:2.3.3:compile
[INFO] |  |  |  \- com.sun.istack:istack-commons-runtime:jar:3.0.11:compile
[INFO] |  |  +- org.apache.ws.xmlschema:xmlschema-core:jar:2.2.4:compile
[INFO] |  |  \- org.glassfish.jaxb:jaxb-xjc:jar:2.3.3:compile
[INFO] |  |     +- org.glassfish.jaxb:xsom:jar:2.3.3:compile
[INFO] |  |     |  \- com.sun.xml.bind.external:relaxng-datatype:jar:2.3.3-b02:compile
[INFO] |  |     +- org.glassfish.jaxb:codemodel:jar:2.3.3:compile
[INFO] |  |     +- com.sun.xml.bind.external:rngom:jar:2.3.3:compile
[INFO] |  |     +- com.sun.xml.dtd-parser:dtd-parser:jar:1.4.3:compile
[INFO] |  |     \- com.sun.istack:istack-commons-tools:jar:3.0.11:compile
[INFO] |  +- org.slf4j:slf4j-api:jar:1.7.30:compile
[INFO] |  +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] |  +- javax.xml.ws:jaxws-api:jar:2.3.1:compile
[INFO] |  |  \- javax.xml.soap:javax.xml.soap-api:jar:1.4.0:compile
[INFO] |  +- com.sun.activation:javax.activation:jar:1.2.0:compile
[INFO] |  +- org.apache.geronimo.specs:geronimo-ws-metadata_2.0_spec:jar:1.1.3:compile
[INFO] |  +- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
[INFO] |  \- org.jboss.spec.javax.rmi:jboss-rmi-api_1.0_spec:jar:1.0.6.Final:compile
[INFO] +- com.mytest:tu:jar:0.0.1-SNAPSHOT:compile
[INFO] |  \- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:2.0.0.CR1:compile
[INFO] +- org.apache.cxf:cxf-spring-boot-starter-jaxws:jar:3.4.2:compile
[INFO] |  +- org.apache.cxf:cxf-spring-boot-autoconfigure:jar:3.4.2:compile
[INFO] |  +- org.apache.cxf:cxf-rt-transports-http:jar:3.4.2:compile
[INFO] |  +- org.apache.cxf:cxf-rt-frontend-jaxws:jar:3.4.2:compile
[INFO] |  |  +- xml-resolver:xml-resolver:jar:1.2:compile
[INFO] |  |  +- org.ow2.asm:asm:jar:9.0:compile
[INFO] |  |  +- org.apache.cxf:cxf-rt-bindings-soap:jar:3.4.2:compile
[INFO] |  |  |  +- org.apache.cxf:cxf-rt-wsdl:jar:3.4.2:compile
[INFO] |  |  |  |  \- wsdl4j:wsdl4j:jar:1.6.3:compile
[INFO] |  |  |  \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:3.4.2:compile
[INFO] |  |  +- org.apache.cxf:cxf-rt-bindings-xml:jar:3.4.2:compile
[INFO] |  |  +- org.apache.cxf:cxf-rt-frontend-simple:jar:3.4.2:compile
[INFO] |  |  \- org.apache.cxf:cxf-rt-ws-addr:jar:3.4.2:compile
[INFO] |  |     \- org.apache.cxf:cxf-rt-ws-policy:jar:3.4.2:compile
[INFO] |  |        \- org.apache.neethi:neethi:jar:3.1.1:compile
[INFO] |  +- org.apache.cxf:cxf-rt-features-metrics:jar:3.4.2:compile
[INFO] |  +- jakarta.validation:jakarta.validation-api:jar:2.0.2:compile
[INFO] |  \- org.springframework.boot:spring-boot-starter-validation:jar:2.4.0:compile
[INFO] |     \- org.hibernate.validator:hibernate-validator:jar:6.1.6.Final:compile
[INFO] |        \- com.fasterxml:classmate:jar:1.5.1:compile
[INFO] +- org.apache.activemq:artemis-spring-integration:jar:2.16.0:compile
[INFO] |  +- org.apache.activemq:artemis-server:jar:2.15.0:compile
[INFO] |  |  +- org.jboss.logging:jboss-logging:jar:3.4.1.Final:compile
[INFO] |  |  +- org.jboss.logmanager:jboss-logmanager:jar:2.1.10.Final:compile
[INFO] |  |  |  \- org.wildfly.common:wildfly-common:jar:1.5.1.Final:compile
[INFO] |  |  +- org.apache.activemq:artemis-journal:jar:2.15.0:compile
[INFO] |  |  +- org.apache.activemq:artemis-jdbc-store:jar:2.15.0:compile
[INFO] |  |  +- org.apache.activemq:activemq-artemis-native:jar:1.0.2:compile
[INFO] |  |  +- org.jctools:jctools-core:jar:2.1.2:compile
[INFO] |  |  +- io.netty:netty-buffer:jar:4.1.54.Final:compile
[INFO] |  |  +- io.netty:netty-transport:jar:4.1.54.Final:compile
[INFO] |  |  |  \- io.netty:netty-resolver:jar:4.1.54.Final:compile
[INFO] |  |  +- io.netty:netty-codec-http:jar:4.1.54.Final:compile
[INFO] |  |  +- io.netty:netty-common:jar:4.1.54.Final:compile
[INFO] |  |  +- io.netty:netty-handler:jar:4.1.54.Final:compile
[INFO] |  |  +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.54.Final:compile
[INFO] |  |  |  \- io.netty:netty-transport-native-unix-common:jar:4.1.54.Final:compile
[INFO] |  |  +- io.netty:netty-transport-native-kqueue:jar:osx-x86_64:4.1.54.Final:compile
[INFO] |  |  +- io.netty:netty-codec:jar:4.1.54.Final:compile
[INFO] |  |  +- commons-beanutils:commons-beanutils:jar:1.9.4:compile
[INFO] |  |  |  \- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] |  |  +- org.apache.commons:commons-configuration2:jar:2.7:compile
[INFO] |  |  |  +- org.apache.commons:commons-lang3:jar:3.11:compile
[INFO] |  |  |  \- org.apache.commons:commons-text:jar:1.8:compile
[INFO] |  |  +- io.micrometer:micrometer-core:jar:1.6.1:compile
[INFO] |  |  |  +- org.hdrhistogram:HdrHistogram:jar:2.1.12:compile
[INFO] |  |  |  \- org.latencyutils:LatencyUtils:jar:2.0.3:runtime
[INFO] |  |  \- commons-io:commons-io:jar:2.6:compile
[INFO] |  +- org.apache.activemq:artemis-jms-server:jar:2.15.0:compile
[INFO] |  |  \- org.apache.activemq:artemis-service-extensions:jar:2.15.0:compile
[INFO] |  \- org.springframework:spring-beans:jar:5.3.1:compile
[INFO] +- org.apache.activemq:artemis-jms-client:jar:2.16.0:compile
[INFO] |  +- org.apache.activemq:artemis-core-client:jar:2.15.0:compile
[INFO] |  |  +- org.jgroups:jgroups:jar:3.6.13.Final:compile
[INFO] |  |  +- org.apache.johnzon:johnzon-core:jar:1.2.8:compile
[INFO] |  |  +- io.netty:netty-handler-proxy:jar:4.1.54.Final:compile
[INFO] |  |  \- io.netty:netty-codec-socks:jar:4.1.54.Final:compile
[INFO] |  +- org.apache.activemq:artemis-commons:jar:2.15.0:compile
[INFO] |  +- org.apache.activemq:artemis-selector:jar:2.15.0:compile
[INFO] |  \- org.apache.geronimo.specs:geronimo-jms_2.0_spec:jar:1.0-alpha-2:compile
[INFO] +- org.apache.cxf.xjc-utils:cxf-xjc-runtime:jar:3.3.1:compile
[INFO] +- org.apache.logging.log4j:log4j-api:jar:2.13.3:compile
[INFO] +- org.apache.logging.log4j:log4j-core:jar:2.13.3:compile
[INFO] \- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.13.3:provided

解决方法

org.apache.activemq:artemis-jms-client 的依赖声明中,您可以排除 org.apache.geronimo.specs:geronimo-jms_2.0_spec,例如:

<dependency>
   <groupId>org.apache.activemq</groupId>
   <artifactId>artemis-jms-client</artifactId>
   <version>2.16.0</version>
   <exclusions>
      <exclusion>
         <groupId>org.apache.geronimo.specs</groupId>
         <artifactId>geronimo-jms_2.0_spec</artifactId>
      </exclusion>
   </exclusions>
</dependency>

然后显式包含另一个 JMS API,例如:

<dependency>
   <groupId>jakarta.jms</groupId>
   <artifactId>jakarta.jms-api</artifactId>
   <version>2.0.3</version>
</dependency>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-
参考1 参考2 解决方案 # 点击安装源 协议选择 http:// 路径填写 mirrors.aliyun.com/centos/8.3.2011/BaseOS/x86_64/os URL类型 软件库URL 其他路径 # 版本 7 mirrors.aliyun.com/centos/7/os/x86
报错1 [root@slave1 data_mocker]# kafka-console-consumer.sh --bootstrap-server slave1:9092 --topic topic_db [2023-12-19 18:31:12,770] WARN [Consumer clie
错误1 # 重写数据 hive (edu)&gt; insert overwrite table dwd_trade_cart_add_inc &gt; select data.id, &gt; data.user_id, &gt; data.course_id, &gt; date_format(
错误1 hive (edu)&gt; insert into huanhuan values(1,&#39;haoge&#39;); Query ID = root_20240110071417_fe1517ad-3607-41f4-bdcf-d00b98ac443e Total jobs = 1
报错1:执行到如下就不执行了,没有显示Successfully registered new MBean. [root@slave1 bin]# /usr/local/software/flume-1.9.0/bin/flume-ng agent -n a1 -c /usr/local/softwa
虚拟及没有启动任何服务器查看jps会显示jps,如果没有显示任何东西 [root@slave2 ~]# jps 9647 Jps 解决方案 # 进入/tmp查看 [root@slave1 dfs]# cd /tmp [root@slave1 tmp]# ll 总用量 48 drwxr-xr-x. 2
报错1 hive&gt; show databases; OK Failed with exception java.io.IOException:java.lang.RuntimeException: Error in configuring object Time taken: 0.474 se
报错1 [root@localhost ~]# vim -bash: vim: 未找到命令 安装vim yum -y install vim* # 查看是否安装成功 [root@hadoop01 hadoop]# rpm -qa |grep vim vim-X11-7.4.629-8.el7_9.x
修改hadoop配置 vi /usr/local/software/hadoop-2.9.2/etc/hadoop/yarn-site.xml # 添加如下 &lt;configuration&gt; &lt;property&gt; &lt;name&gt;yarn.nodemanager.res