gpt4 book ai didi

java - 服务 jboss.web.deployment.default-host./.realm 已经注册

转载 作者:搜寻专家 更新时间:2023-11-01 03:24:39 25 4
gpt4 key购买 nike

我正在尝试将三个不同的 ear 文件部署到同一个 Jboss 服务器...

其中一个没有上下文根,另外两个有,但不同。我的意思是,让我们把三只耳朵当作一只耳朵、两只耳朵和三只耳朵:

one.ear 有:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<context-root>/</context-root>
</jboss-web>

two.ear 有:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<context-root>/two</context-root>
</jboss-web>

three.ear 没有。

当我尝试为 Jboss (7 AS) 加注星标时,我得到了这个:

16:01:31,962 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.deployment.subunit."one-ear.ear"."one.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."one-ear.ear"."one.war".INSTALL: Failed to process phase INSTALL of subdeployment "one.war" of deployment "one-ear.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_45]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_45]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018027: Failed to add JBoss Web deployment service
at org.jboss.as.web.deployment.WarDeploymentProcessor.processDeployment(WarDeploymentProcessor.java:320)
at org.jboss.as.web.deployment.WarDeploymentProcessor.deploy(WarDeploymentProcessor.java:114)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.web.deployment.default-host./.realm is already registered
at org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:154) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:227) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:560) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2228) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2228) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:307) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.as.web.deployment.WarDeploymentProcessor.processDeployment(WarDeploymentProcessor.java:269)
... 7 more

我读到当同一服务器中的两个应用程序具有相同的上下文根时可能会抛出此错误,但事实并非如此...发生了什么?

最佳答案

一般Jboss等容器的context root是

<context-root>/</context-root>

拦截所有传入的请求并传递给应用程序服务器。在你我怀疑冲突的应用程序是 JBoss AppServer root 本身,你可以使用以下 (enable-welcome-root="false")

<subsystem xmlns="urn:jboss:domain:web:1.0">
<connector name="http" protocol="HTTP/1.1" socket-binding="http" scheme="http"/>
<virtual-server name="localhost" enable-welcome-root="false">
<alias name="example.com"/>
</virtual-server>
</subsystem>

关于java - 服务 jboss.web.deployment.default-host./.realm 已经注册,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17926276/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com