Java 服务 jboss.web.deployment.default-host./ 中的 org.jboss.msc.service.StartException:无法启动服务

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30701533/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 10:01:22  来源:igfitidea点击:

org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./: Failed to start service

javajakarta-eejboss

提问by Dev Anand Sadasivam

This should be the very common problem that everyone will be facing while deployment. You will be failing if you deploy a web archive (.war)under /context.

这应该是每个人在部署时都会面临的非常普遍的问题。如果您(.war)/上下文中部署 Web 存档,您将失败。

The error in JBoss console will be like this,

JBoss 控制台中的错误将是这样的,

Internal Server Error { "outcome" => "failed", "failure-description" => {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./: Failed to start service Caused by: java.lang.IllegalArgumentException: JBWEB000250: Child container with name already exists"}}, "rolled-back" => true }

内部服务器错误 {“结果”=>“失败”,“失败描述”=>{“JBAS014671:失败的服务”=>{“jboss.web.deployment.default-host./”=>“org.jboss. msc.service.StartException in service jboss.web.deployment.default-host./: 无法启动服务引起:java.lang.IllegalArgumentException: JBWEB000250: 具有名称的子容器已经存在"}}, "rolled-back" = > 真 }

The problem comes because of the following configuration in standalone.xml

问题出在以下配置中 standalone.xml

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

采纳答案by Dev Anand Sadasivam

To fix this,

为了解决这个问题,

enable-welcome-root="true"to be made "false"

enable-welcome-root="true"被制造 "false"

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