2013-07-29 142 views
4

我想三個不同的ear文件部署到同一個JBoss服務器...服務jboss.web.deployment.default-host./.realm已經註冊

其中一人沒有一個上下文根,另外兩個有它,但它不同。我的意思是,讓我們三個耳朵one.ear,two.ear和three.ear:

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> 

3 .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 

我已閱讀,當在同一臺服務器兩個應用程序具有相同的上下文根這個錯誤可能會被拋出,但是這情況並非如此......發生了什麼?

回答

2

通常該容器例如JBoss具有

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

上下文根攔截所有傳入的請求和傳遞給應用服務器。在你我懷疑有衝突的應用程序是JBoss的應用服務器根目錄本身,你可以禁用,使用以下(啓用,歡迎根=「假」)

<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> 
+0

我已經有這樣的方式:/ – diminuta

+0

@Juned,它不是解決案件。 –

+0

不適合我 – LegionDev

0

檢查其--server-config文件是用來啓動服務器。在我的情況下,這是standalone-ha.xml,而不是預期的standalone.xml

相關問題