【问题标题】:Getting HTTP status 404 on deploying war on tomcat maven在 tomcat maven 上部署战争时获取 HTTP 状态 404
【发布时间】:2013-11-08 07:23:14
【问题描述】:

我正在构建一个开源 android moteve 视频流项目的 war 文件,并使用 mvn tomcat:deploy 命令从我的终端将其部署到 tomcat,在终端上它显示消息构建成功,但在链接时它显示 HTTP 状态- 404 , 请求的资源 (/motevwebapp/) 不可用。我陷入了这个错误,无法解决它。请有人帮助我。提前致谢。

这是我的 pom.xml

   <project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
 <parent>
    <groupId>com.moteve</groupId>
    <artifactId>moteve-server-parent</artifactId>
    <version>${moteve-server-parent-version}</version>
    <relativePath>../moteve-server-parent/pom.xml</relativePath>
  </parent>
 <groupId>com.moteve</groupId>
  <artifactId>moteve-server-webapp</artifactId>
  <packaging>war</packaging>
  <version>${moteve-server-webapp-version}</version>
  <name>Moteve Web Application</name>
  <url>http://moteve.com</url>
 <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.moteve</groupId>
      <artifactId>moteve-server-core</artifactId>
      <version>${moteve-server-core-version}</version>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>${log4j-version}</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>${servlet-api-version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>${spring-webmvc-version}</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit-version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <finalName>moteve-server-webapp</finalName>
<plugins>
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <configuration>
            <server>myserver</server>
            <username>admin</username>
            <password>admin</password>
 <url>http://localhost:8080/manager/text</url>
<path>/motevwebapp</path> 

    </configuration>
</plugin>
</plugins>
  </build>
</project>

【问题讨论】:

    标签: maven-tomcat-plugin


    【解决方案1】:

    请使用 Apache 的最新版本(codehaus 代码已移至 Apache)。

    http://tomcat.apache.org/maven-plugin.html

    【讨论】:

    • 感谢您的回复,在我的 pom.xml 中替换什么,因为我是 tomcat 服务器的新手,我对 java 中的 servlet 和 spring 框架一无所知,如果您不知道,还有一件事请注意,我是否必须在我的 web.xml 文件中输入所有控制器。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-14
    相关资源
    最近更新 更多