我运行了以下命令: /opt/wildfly/bin/jboss-cli.sh --file /opt/wildfly/docs/examples/enable-microprofile.cli
运行上述脚本后,我得到以下成功消息:
INFO: Updating configuration to use elytron
{"outcome" => "success"}
{"outcome" => "success"}
{"outcome" => "success"}
{"outcome" => "success"}
{"outcome" => "success"}
{"outcome" => "success"}
{
"outcome" => "success",
"response-headers" => {
"operation-requires-reload" => true,
"process-state" => "reload-required"
}
}
{
"outcome" => "success",
"response-headers" => {
"operation-requires-reload" => true,
"process-state" => "reload-required"
}
}
{
"outcome" => "success",
"response-headers" => {
"operation-requires-reload" => true,
"process-state" => "reload-required"
}
}
INFO: Removing security subsystem and ManagementRealm.
{
"outcome" => "success",
"response-headers" => {"process-state" => "reload-required"}
}
{
"outcome" => "success",
"response-headers" => {"process-state" => "reload-required"}
}
{
"outcome" => "success",
"response-headers" => {"process-state" => "reload-required"}
}
INFO: Adding microprofile subsystems.
{
"outcome" => "success",
"response-headers" => {"process-state" => "reload-required"}
}
{
"outcome" => "success",
"response-headers" => {"process-state" => "reload-required"}
}
INFO: microprofile-jwt-smallrye already in configuration, subsystem not added.
{
"outcome" => "success",
"response-headers" => {"process-state" => "reload-required"}
}
{
"outcome" => "success",
"response-headers" => {"process-state" => "reload-required"}
}
INFO: Configuration done.现在,当我启动JBoss时,我得到以下错误。主要错误是ELY01148: SecurityDomain已经与指定的ClassLoader关联。
geonames-service_1 | 13:54:28,929 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."geonames-service-1.0-snapshot.war".undertow-deployment.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jboss.deployment.unit."geonames-service-1.0-snapshot.war".undertow-deployment.UndertowDeploymentInfoService: Failed to start service
geonames-service_1 | at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
geonames-service_1 | at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
geonames-service_1 | at org.jboss.threads@2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
geonames-service_1 | at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
geonames-service_1 | at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
geonames-service_1 | at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
geonames-service_1 | at java.base/java.lang.Thread.run(Thread.java:834)
geonames-service_1 | Caused by: java.lang.IllegalStateException: ELY01148: A SecurityDomain has already been associated with the specified ClassLoader
geonames-service_1 | at org.wildfly.security.elytron-private@1.12.1.Final//org.wildfly.security.auth.server.SecurityDomain.registerWithClassLoader(SecurityDomain.java:150)
geonames-service_1 | at org.wildfly.security.elytron-web.undertow-server-servlet@1.7.1.Final//org.wildfly.elytron.web.undertow.server.servlet.AuthenticationManager.configure(AuthenticationManager.java:91)
geonames-service_1 | at org.wildfly.extension.undertow@20.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.applyElytronSecurity(UndertowDeploymentInfoService.java:1242)
geonames-service_1 | at org.wildfly.extension.undertow@20.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:957)
geonames-service_1 | at org.wildfly.extension.undertow@20.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.start(UndertowDeploymentInfoService.java:276)
geonames-service_1 | at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
geonames-service_1 | at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
geonames-service_1 | ... 6 more
geonames-service_1 |
geonames-service_1 | 13:54:28,939 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "geonames-service-1.0-snapshot.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"geonames-service-1.0-snapshot.war\".undertow-deployment.UndertowDeploymentInfoService" => "Failed to start service
geonames-service_1 | Caused by: java.lang.IllegalStateException: ELY01148: A SecurityDomain has already been associated with the specified ClassLoader"}}
geonames-service_1 | 13:54:29,079 INFO [org.jboss.as.server] (ServerService Thread Pool -- 46) WFLYSRV0010: Deployed "geonames-service-1.0-snapshot.war" (runtime-name : "geonames-service-1.0-snapshot.war")
geonames-service_1 | 13:54:29,090 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
geonames-service_1 | WFLYCTL0186: Services which failed to start: service jboss.deployment.unit."geonames-service-1.0-snapshot.war".undertow-deployment.UndertowDeploymentInfoService: Failed to start service
geonames-service_1 | WFLYCTL0448: 19 additional services are down due to their dependencies being missing or failed
geonames-service_1 | 13:54:29,220 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
geonames-service_1 | 13:54:29,222 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 20.0.0.Final (WildFly Core 12.0.1.Final) started (with errors) in 19167ms - Started 440 of 779 services (22 services failed or missing dependencies, 464 services are lazy, passive or on-demand)
geonames-service_1 | 13:54:29,234 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://0.0.0.0:9990/management
geonames-service_1 | 13:54:29,234 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://0.0.0.0:9990请提供任何建议。
发布于 2021-10-26 21:28:10
我在使用WildFly25和(使用Elytron1.17.1)时得到了相同的异常,在快速入门之后使用BEARER_TOKEN作为登录机制:https://github.com/wildfly/quickstart/tree/main/jaxrs-jwt
出现这个问题是因为我使用了EJB和ReST端点,并且我的war使用了不同的SecurityDomain。
我将安全域切换到JWT域,如下所示:
<subsystem xmlns="urn:jboss:domain:ejb3:9.0">
...
<application-security-domain name="other" security-domain="jwt-domain"/>https://stackoverflow.com/questions/64264202
复制相似问题