将保持简短。 我们的任务是在类里面遵循本教程: https://webdev.jhuep.com/~jcs/ejava-javaee/coursedocs/content/html_single/ejb-basic-lab-book.html#ejb-basicex-modules-server-setup
教程有时非常快,而且令人困惑。我的问题是我已经到了 2.3,并且我刚刚制作了我的测试模块,并且我的服务器已启动并且正在执行 MVN 全新安装。
我收到此错误消息:
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.82 s <<< FAILURE! - in org.myorg.basicejb.earejb.ReservationIT
[ERROR] testPing(org.myorg.basicejb.earejb.ReservationIT) Time elapsed: 0.703 s <<< ERROR!
javax.naming.NameNotFoundException: jms -- service jboss.naming.context.java.jboss.exported.jms
我到处都查过了,但我不完全确定这是怎么回事。这是我的应用程序找不到服务器的名称吗?因为如果我关闭服务器,它就无法找到并连接,所以我也不确定它的名称。
我知道我的问题可能含糊不清,但我到底错过了什么?本教程是否假设我应该了解更多有关 JBoss/Wildfly 的信息? (比如,我应该在 JBoss 内部做些什么吗?)
再说一遍,我对这一切都很陌生,非常感谢我能得到的任何帮助。
最佳答案
当您使用 ./bin/standalone.sh
命令启动 Wildfly 时,它会使用 $WILDFLY_HOME/standalone/configuration 目录中的 standalone.xml
。来自 this link如果您想使用 JMS,则需要“完整”版本:
Standalone Server Configurations
standalone.xml (default)
Java Enterprise Edition 8 web profile certified configuration with the required technologies plus those noted in the table above.
standalone-ha.xml
Java Enterprise Edition 8 web profile certified configuration with high availability
standalone-full.xml
Java Enterprise Edition 8 full profile certified configuration including all the required EE 8 technologies
standalone-full-ha.xml
Java Enterprise Edition 8 full profile certified configuration with high availability
要使用完整版本运行,请将命令行更改为:
./bin/standalone.sh -c standalone-full.xml
关于JavaX 命名.NameNotFoundException 与 Jboss/Wildfly,这个名字是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57876346/