Wildfly + Eclipse 部署扫描程序

Posted

技术标签:

【中文标题】Wildfly + Eclipse 部署扫描程序【英文标题】:Wildfly + Eclipse Deployment Scanners 【发布时间】:2021-10-30 12:55:12 【问题描述】:

我对使用服务器完全不熟悉,我正在尝试为下周开始的课程设置一些软件。在尝试让 Wildfly 通过 Eclipse 工作时,我一直遇到这个问题。我去运行服务器,每次,无论我选择什么版本,我总是得到同样的错误信息:

在“更新服务器的部署扫描程序:WildFly 24+”期间发生内部错误。 无法初始化类 org.wildfly.security.auth.client.DefaultAuthenticationContextProvider

这里也是控制台日志

19:43:26,466 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.12.Final
19:43:26,474 INFO  [org.jboss.threads] (main) JBoss Threads version 2.4.0.Final
19:43:26,565 INFO  [org.jboss.as] (MSC service thread 1-1) WFLYSRV0049: WildFly Full 24.0.1.Final (WildFly Core 16.0.1.Final) starting
19:43:27,102 INFO  [org.wildfly.security] (ServerService Thread Pool -- 28) ELY00001: WildFly Elytron version 1.16.1.Final
19:43:27,346 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 22) WFLYCTL0033: Extension 'security' is deprecated and may not be supported in future versions
19:43:27,542 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
19:43:27,561 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 16) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
19:43:27,614 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
19:43:27,629 INFO  [org.xnio] (MSC service thread 1-4) XNIO version 3.8.4.Final
19:43:27,635 INFO  [org.xnio.nio] (MSC service thread 1-4) XNIO NIO Implementation Version 3.8.4.Final
19:43:27,665 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 54) WFLYIO001: Worker 'default' has auto-configured to 24 IO threads with 192 max task threads based on your 12 available processors
19:43:27,669 INFO  [org.wildfly.extension.health] (ServerService Thread Pool -- 52) WFLYHEALTH0001: Activating Base Health Subsystem
19:43:27,671 INFO  [org.wildfly.extension.microprofile.config.smallrye] (ServerService Thread Pool -- 63) WFLYCONF0001: Activating MicroProfile Config Subsystem
19:43:27,671 INFO  [org.wildfly.extension.microprofile.jwt.smallrye] (ServerService Thread Pool -- 64) WFLYJWT0001: Activating MicroProfile JWT Subsystem
19:43:27,672 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 53) WFLYCLINF0001: Activating Infinispan subsystem.
19:43:27,673 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 74) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value. This is a danger for environments running multiple servers. Please make sure the attribute value is unique.
19:43:27,680 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 60) WFLYJSF0007: Activated the following Jakarta Server Faces Implementations: [main]
19:43:27,686 INFO  [org.wildfly.extension.microprofile.opentracing] (ServerService Thread Pool -- 65) WFLYTRACEXT0001: Activating MicroProfile OpenTracing Subsystem
19:43:27,689 INFO  [org.wildfly.extension.metrics] (ServerService Thread Pool -- 62) WFLYMETRICS0001: Activating Base Metrics Subsystem
19:43:27,694 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 72) WFLYSEC0002: Activating Security Subsystem
19:43:27,700 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 66) WFLYNAM0001: Activating Naming Subsystem
19:43:27,715 INFO  [org.jboss.as.jaxrs] (ServerService Thread Pool -- 55) WFLYRS0016: RESTEasy version 3.15.1.Final
19:43:27,717 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 76) WFLYWS0002: Activating WebServices Extension
19:43:27,727 INFO  [org.jboss.as.security] (MSC service thread 1-4) WFLYSEC0001: Current PicketBox version=5.0.3.Final-redhat-00007
19:43:27,766 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0003: Undertow 2.2.8.Final starting
19:43:27,768 INFO  [org.jboss.as.connector] (MSC service thread 1-7) WFLYJCA0009: Starting Jakarta Connectors Subsystem (WildFly/IronJacamar 1.4.35.Final)
19:43:27,768 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 44) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4)
19:43:27,781 INFO  [org.jboss.remoting] (MSC service thread 1-5) JBoss Remoting version 5.0.23.Final
19:43:27,812 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) WFLYJCA0018: Started Driver service with driver-name = h2
19:43:27,817 INFO  [org.jboss.as.naming] (MSC service thread 1-3) WFLYNAM0003: Starting Naming Service
19:43:27,821 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-2) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
19:43:27,892 WARN  [org.wildfly.extension.elytron] (MSC service thread 1-5) WFLYELY00023: KeyStore file 'C:\Users\USER\wildfly-24.0.1.Final\standalone\configuration\application.keystore' does not exist. Used blank.
19:43:27,894 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 75) WFLYUT0014: Creating file handler for path 'C:\Users\USER\wildfly-24.0.1.Final/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
19:43:27,934 WARN  [org.wildfly.extension.elytron] (MSC service thread 1-7) WFLYELY01084: KeyStore C:\Users\USER\wildfly-24.0.1.Final\standalone\configuration\application.keystore not found, it will be auto generated on first use with a self-signed certificate for host localhost
19:43:27,963 INFO  [org.jboss.as.ejb3] (MSC service thread 1-7) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 192 (per class), which is derived from thread worker pool sizing.
19:43:27,963 INFO  [org.jboss.as.ejb3] (MSC service thread 1-5) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 48 (per class), which is derived from the number of CPUs on this host.
19:43:27,967 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0012: Started server default-server.
19:43:27,970 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-8) Queuing requests.
19:43:27,972 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0018: Host default-host starting
19:43:28,033 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
19:43:28,149 INFO  [org.jboss.as.ejb3] (MSC service thread 1-6) WFLYEJB0493: Jakarta Enterprise Beans subsystem suspension complete
19:43:28,188 INFO  [org.jboss.as.patching] (MSC service thread 1-2) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
19:43:28,192 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
19:43:28,198 WARN  [org.jboss.as.domain.management.security] (MSC service thread 1-7) WFLYDM0111: Keystore C:\Users\USER\wildfly-24.0.1.Final\standalone\configuration\application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
19:43:28,202 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) WFLYDS0013: Started FileSystemDeploymentService for directory C:\Users\USER\wildfly-24.0.1.Final\standalone\deployments
19:43:28,220 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
19:43:28,267 INFO  [org.jboss.ws.common.management] (MSC service thread 1-8) JBWS022052: Starting JBossWS 5.4.4.Final (Apache CXF 3.3.10) 
19:43:28,329 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
19:43:28,331 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 24.0.1.Final (WildFly Core 16.0.1.Final) started in 2670ms - Started 319 of 558 services (344 services are lazy, passive or on-demand)
19:43:28,332 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
19:43:28,333 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990

我觉得我可能只是在这里遗漏了一些非常基本的东西;正如我所说,我对此很陌生。服务器确实在技术上运行,但没有扫描仪我无法访问任何项目目录。

非常感谢您的帮助!

【问题讨论】:

我遇到同样的错误,不知道为什么 :( 我正在使用 Java 11 重新安装 Eclipse 和 JBoss。 【参考方案1】:

我在将 Java 从 11 升级到 17 时也遇到了这个问题。研究根本原因使我找到了a discussion on google。看起来自 Java 11 以来某些访问限制发生了变化,可以通过添加来解决问题

--add-opens=java.base/java.security=ALL-UNNAMED

eclipse.ini 中的-vmargs 部分。

【讨论】:

这对我有用。【参考方案2】:

看起来这可能是由于运行 Java 1.8 作为默认 Java 安装(即 Java 1.8 是 PATH 环境变量中的第一个)。

我能够通过使用以下安装解决此问题

jdk-11.0.11_windows-x64_bin.zip wildfly-24.0.1.Final.zip eclipse-jee-2021-03-R-win32-x86_64.zip

然后将 jdk-11.011 的安装添加到我的 Path 变量的开头。然后,我能够通过将 Java 1.8 版本添加到我的路径变量来重现该问题。例如,下面的配置给出了错误。删除第一行即可解决错误。

这给出了错误

这行得通!!!

为确保您使用的是 Java 11,请打开一个 cmd 窗口并输入 java -version

【讨论】:

这个问题不仅可以在 Java 8 中重现,而且在 Java 16+ 中也可以重现。我没有测试其他人(例如 9-10 和 12-15)。服务器本身配置为使用什么 JVM 运行并不重要,而只关心 JVM eclipse 的启动方式。 我可以使用“Red Hat JBoss EAP 7.3”的 java 版本“11.0.10”2021-01-19 LTS 重现该问题。如@irieill 回复中所述,将 --add-opens=java.base/java.security=ALL-UNNAMED 添加到 eclipse.ini 为我解决了这个问题。

以上是关于Wildfly + Eclipse 部署扫描程序的主要内容,如果未能解决你的问题,请参考以下文章

如何配置从 Eclipse 到 Wildfly 的部署

Wildfly Maven插件+热部署

Eclipse Kepler 和 JBoss Wildfly 热部署

通过 Eclipse 在 Docker 上调试 Wildfly 应用程序?

Spring Boot 应用程序未部署在 Wildfly 上

在不同于 localhost 的地址上使用 wildfly maven 插件部署应用程序