8 Replies Latest reply on Aug 2, 2013 2:16 PM by meenakshi0102

    DeploymentException: Web mapping already exists for deployme

    leogregory

      I am brand new to JBoss and am evaluating version 5.0.0 for a new development environment that is urgently needed.

      I have started with the simple example documented below and deployed the resulting war file to
      "C:/MyStuff/jboss-5.0.0/server/default/deploy/hello.war".

      Upon starting JBoss, I get the following exception:

      org.jboss.deployers.spi.DeploymentException: Web mapping already exists for deployment URL file:/C:/MyStuff/jboss-5.0.0.
      GA/server/default/tmp/deploy/hello56098-exp.war/

      I'll get an "HTTP Status 404 error . . . The requested resource (/hello.jsp) is not available" when trying to access the URL: http://localhost:8080/hello.jsp.

      Any help is most appreciated,

      Greg

      CONFIGURATION & DEPLOYMENT INFO:

      hello.jsp file:

      <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
      <html>
       <head>
       <title>No Title</title>
       </head>
       <body>
       <h1>
       Hello!!!
       </h1>
       </body>
      </html>


      build.xml:
      <?xml version="1.0"?>
      <project name="Hello Build File" default="main" basedir=".">
       <!-- Standard Properties -->
       <property name="top.dir" value="."/>
       <property name="src.dir" value="${top.dir}/src"/>
       <property name="lib.dir" value="${top.dir}/src/lib"/>
       <property name="jboss.dir" value="C:/MyStuff/jboss-5.0.0.GA/"/>
       <property name="jboss.deploy.dir" value="${jboss.dir}/server/default/deploy"/>
       <target name="clean">
       <echo message="In clean"/>
       <delete file="${top.dir}/hello.war"/>
       </target>
       <target name="main">
       <echo message="In main"/>
       <war warfile="hello.war" webxml="${src.dir}/metadata/web.xml">
       <webinf dir="${src.dir}/metadata" />
       <fileset dir="${src.dir}/appfiles"/>
       <lib dir="${lib.dir}"/>
       </war>
       <antcall target="deploy"/>
       </target>
       <target name="deploy">
       <echo message="In deploy"/>
       <copy file="${top.dir}/hello.war" todir="${jboss.deploy.dir}"/>
       </target>
       <target name="undeploy">
       <echo message="In undeploy"/>
       <delete>
       <fileset id="hello_wars" dir="${jboss.deploy.dir}"
       includes="*hello*.war"/>
       </delete>
       </target>
      </project>


      web.xml:
      <?xml version="1.0" ?>
      <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
       version="2.4">
       <servlet>
       <servlet-name>HelloServlet</servlet-name>
       <jsp-file>/hello.jsp</jsp-file>
       </servlet>
       <servlet-mapping>
       <servlet-name>HelloServlet</servlet-name>
       <url-pattern>/HelloTest</url-pattern>
       </servlet-mapping>
      </web-app>


      jboss-web.xml:
      <!DOCTYPE jboss-web PUBLIC
       "-//JBoss//DTD Web Application 2.4//EN"
       "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
      <jboss-web>
       <context-root>/</context-root>
      </jboss-web>


        • 1. Re: DeploymentException: Web mapping already exists for depl
          jaikiran

           

          org.jboss.deployers.spi.DeploymentException: Web mapping already exists for deployment URL file:/C:/MyStuff/jboss-5.0.0.
          GA/server/default/tmp/deploy/hello56098-exp.war/


          By default. there is a ROOT.war in the deploy folder of JBoss which gets bound to / context. Earlier versions of JBoss did not throw an exception when some other application too tried binding its context to /. But looks like JBoss-5GA is stricter (which i believe is good) in this. So i would recommend you either remove the ROOT.war from the deploy folder or change the context-root in your jboss-web.xml to something else, like:

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


          Then you can access the jsp through http://localhost:8080/myApp/hello.jsp

          • 2. Re: DeploymentException: Web mapping already exists for depl
            leogregory

            jaikiran,

            Thank you very much! Your solution worked without a hitch. New versions can be challenging until documentation becomes mainstream.

            Greg

            • 3. Re: DeploymentException: Web mapping already exists for depl
              devfool

              jaikiran,

              I had same problem and it's still.
              I changed "context-root" in jboss-web.xml but whenver i deploy WAR file again , this message "Web mapping already exists for deployment URL file" will occure.

              Please help me to solve problem , Thanks you

              • 4. Re: DeploymentException: Web mapping already exists for depl
                jaikiran

                 

                I changed "context-root" in jboss-web.xml but whenver i deploy WAR file again , this message " Web mapping already exists for deployment URL file " will occure.


                As noted in my previous reply:

                By default. there is a ROOT.war in the deploy folder of JBoss which gets bound to / context. Earlier versions of JBoss did not throw an exception when some other application too tried binding its context to /. But looks like JBoss-5GA is stricter (which i believe is good) in this. So i would recommend you remove the ROOT.war from the deploy folder


                You will have to remove the ROOT.war folder or rename ROOT.war to something else (ex: JBossRoot.war)


                • 5. Re: DeploymentException: Web mapping already exists for depl
                  devfool

                  I removed the ROOT.war folder before run JBoss and re-deploy myApp.war but not work.

                  Please see output:

                  08:39:23,273 INFO [TomcatDeployment] deploy, ctxPath=/myApp, vfsUrl=myApp.war
                  08:39:23,273 ERROR [AbstractKernelController] Error installing to Start: name=jboss.web.deployment:war=/myApp state=Create mode=Manual requiredState=Installed
                  org.jboss.deployers.spi.DeploymentException: Web mapping already exists for deployment URL file:/C:/JBoss/5.0.0.GA/server/default/tmp/deploy/myApp16062-exp.war/
                  at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:192)
                  at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146)
                  at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:460)
                  at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
                  at org.jboss.web.deployers.WebModule.start(WebModule.java:96)
                  .......


                  08:39:23,304 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/JBoss/5.0.0.GA/server/default/deploy/myApp.war state=PreReal
                  mode=Manual requiredState=Real
                  org.jboss.deployers.spi.DeploymentException: Web mapping already exists for deployment URL file:/C:/JBoss/5.0.0.GA/server/default/tmp/deploy/myApp16062-exp.war/
                  at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:192)
                  at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146)
                  at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:460)
                  at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
                  at org.jboss.web.deployers.WebModule.start(WebModule.java:96)
                  ....


                  08:39:23,304 WARN [HDScanner] Failed to process changes
                  org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

                  *** CONTEXTS IN ERROR: Name -> Error

                  vfszip:/C:/JBoss/5.0.0.GA/server/default/deploy/myApp.war -> org.jboss.deployers.spi.DeploymentException: Web mapping already exists for deployment URL file:/C:/JBoss/5.0.0.GA/server/default/tmp/deploy/myApp16062-exp.war/


                  at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:863)
                  at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:665)
                  at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:293)
                  at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
                  at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
                  at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
                  at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
                  ...


                  • 6. Re: DeploymentException: Web mapping already exists for depl
                    jaikiran

                     

                    08:39:23,273 INFO [TomcatDeployment] deploy, ctxPath=/myApp, vfsUrl=myApp.war
                    08:39:23,273 ERROR [AbstractKernelController] Error installing to Start: name=jboss.web.deployment:war=/myApp state=Create mode=Manual requiredState=Installed
                    org.jboss.deployers.spi.DeploymentException: Web mapping already exists for deployment URL file:/C:/JBoss/5.0.0.GA/server/default/tmp/deploy/myApp16062-exp.war/


                    Notice that it is trying to install the war at /myApp context and is failing. Which means that there is some other application which is already deployed at /myApp context. You will have to check the logs to see which one it is.


                    • 7. Re: DeploymentException: Web mapping already exists for depl

                      I have a similar error when I deploy xindice-1.1 in jboss-5.0.0.GA and I have done that say jaikiran but I don't get anything.

                      Here it is my detailed error:

                      http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211733#4211733

                      • 8. Re: DeploymentException: Web mapping already exists for deployme
                        meenakshi0102

                        Thanks it worked well for me.