2013-04-10 100 views
0

我不明白爲什麼在部署我的webapp時出現錯誤。在第一次部署工作但從第二我得到這個錯誤:在JBOSS 5.1中部署WAR時出現錯誤

DEPLOYMENTS IN ERROR: Deployment "vfszip:/C:/jboss/deploy/TestServlet.war/" is in error due to the following reason(s): org. jboss.deployers.spi.DeploymentException: Web mapping already exists for deployment URL file:/C:/jboss/tmp/a6q5r3z-z5l3qt-hfcant4w-1-hfclha33-ta/TestServlet.war/

我在網絡上的多個線程,我要加入到WEB-INF文件夾中的jboss-web.xml文件讀取。所以我添加了以下內容,但我仍然得到了同樣的錯誤:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE jboss-web PUBLIC 
    "-//JBoss//DTD Web Application 5.0//EN" 
    "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd"> 
<jboss-web> 
    <context-root>/TestServlet</context-root> 
</jboss-web> 

的AS是JBOSS 5.1

回答

1

變化<context-root>/TestServlet</context-root><context-root>TestServlet</context-root>。 '/'在這裏不需要。請嘗試。還有一件事,你有沒有ROOT.war在Jboss

+0

謝謝,我刪除了ROOT.war並重命名了內容,它的工作! 但還有一個問題,爲什麼如果我嘗試重新部署相同的戰爭,我會得到相同的錯誤?我能做什麼? – 2013-04-11 09:26:35

+0

我建議你只刪除ROOT.war並恢復回jboss-web.xml,這裏的問題是當其他應用程序嘗試將上下文綁定到'/'時,JBoss 5拋出異常。因此,在刪除ROOT.war(並且您嘗試只安裝一個應用程序)後,沒有其他應用程序映射到「/」。然後你將能夠訪問http:// localhost:8080/TestServlet/whatever.jsp – SAP 2013-04-12 00:52:36