DeploymentException: Web mapping already exists for deployme
leogregory Dec 10, 2008 9:16 PMI 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>