java 服务 jboss.web.deployment.default-host./.realm 已经注册
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17926276/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Service jboss.web.deployment.default-host./.realm is already registered
提问by diminuta
I'm trying to deploy three different ear files to the same Jboss server...
我正在尝试将三个不同的 ear 文件部署到同一个 Jboss 服务器...
One of them doesn't have a context root, and the other two have it, but it's different. I mean, let's take the three ears as one.ear, two.ear and three.ear:
其中一个没有上下文根,另外两个有,但是不同。我的意思是,让我们把三个耳朵当作 one.ear、two.ear 和three.ear:
one.ear has:
one.ear 有:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<context-root>/</context-root>
</jboss-web>
two.ear has:
two.ear 有:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<context-root>/two</context-root>
</jboss-web>
three.ear has none.
三.ear 没有。
When I try to star Jboss (7 AS), I got this:
当我尝试给 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
I have read that this error could be thrown when two apps in the same server have the same context root, but this is not the case... what is happening?
我已经读到当同一服务器中的两个应用程序具有相同的上下文根时可能会引发此错误,但事实并非如此......发生了什么?
回答by Juned Ahsan
Generally the containers such as Jboss have a context root of
通常,Jboss 等容器的上下文根为
<context-root>/</context-root>
to intercept all the incoming requests and pass on to the application server. In your I suspect the conflicting app is JBoss AppServer root itself, you can disable that using the following (enable-welcome-root="false")
拦截所有传入的请求并传递给应用程序服务器。在您我怀疑冲突的应用程序是 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>
回答by Vladyslav Bondarenko
Check which --server-config
file is used to start the server. In my case that was standalone-ha.xml
instead of the expected standalone.xml
.
检查--server-config
用于启动服务器的文件。在我的情况下,这standalone-ha.xml
不是预期的standalone.xml
.
回答by Radhwen
As of to me, restarting the JBoss Server was enough. No idea why.
对我来说,重新启动 JBoss 服务器就足够了。 不知道为什么。
回答by stakahop
Try to remove .war
archive from web server, then deploy again. You can do this through jboss management console. It also could be that you have deployed another application with same value of <context-root>
element in jboss-web.xml
.
尝试.war
从 Web 服务器中删除存档,然后重新部署。您可以通过 jboss 管理控制台执行此操作。也可能是您部署了另一个具有相同<context-root>
元素值的应用程序jboss-web.xml
。
回答by Ashish Shetkar
this solved my problem - go to your standalone.xml - the one which is being reffered by JBoss
这解决了我的问题 - 转到您的 standalone.xml - JBoss 推荐的那个
In the standalone.xml - you will find the deployment section
在 standalone.xml - 你会找到部署部分
<deployments>
<deployment name="YOUR_APP.ear" runtime-name="YOUR_APP-version-SNAPSHOT.ear">
<fs-archive path="C:\YOUR_APP-version-SNAPSHOT.ear"/>
</deployment>
</deployments>
if you are trying to deploy the newer versions or different version of your ear - the it will give such error.
如果您尝试部署较新版本或不同版本的耳朵 - 它会出现此类错误。
Remove this part from the deployments section and keep it empty
从部署部分中删除此部分并将其保留为空
<deployments>
<!-- remove the deployment from here -->
</deployments>
then just restart your server - it will deploy the YOUR_APP.ear again
然后只需重新启动您的服务器 - 它会再次部署 YOUR_APP.ear
and now it will show it with - NEW version
现在它将显示 - 新版本
<deployments>
<deployment name="YOUR_APP.ear" runtime-name="YOUR_APP-NEW_version-SNAPSHOT.ear">
<fs-archive path="C:\YOUR_APP-_NEW_version-SNAPSHOT.ear"/>
</deployment>
</deployments>