Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/361.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 通过web app runner与maven一起部署时缺少资源_Java_Eclipse_Git_Maven_Heroku - Fatal编程技术网

Java 通过web app runner与maven一起部署时缺少资源

Java 通过web app runner与maven一起部署时缺少资源,java,eclipse,git,maven,heroku,Java,Eclipse,Git,Maven,Heroku,描述:我已经尝试过这个教程,但它不适合我。我的maven应用程序最初是一个动态web应用程序,当我通过Eclipse部署它时,转换为maven项目可以正常工作,但是如果我试图通过webapp runner在git bash中部署它,Tomcat会说请求的资源不可用。我正在运行apache-maven-3.2.3 pom.xml: web.xml: 有什么问题吗?提前谢谢你 您是否正在获取请求的资源不可用。在Heroku上运行时发出消息?您的Procfile看起来像什么?可能值得在webapp-r

描述:我已经尝试过这个教程,但它不适合我。我的maven应用程序最初是一个动态web应用程序,当我通过Eclipse部署它时,转换为maven项目可以正常工作,但是如果我试图通过webapp runner在git bash中部署它,Tomcat会说请求的资源不可用。我正在运行apache-maven-3.2.3

pom.xml:

web.xml:


有什么问题吗?提前谢谢你

您是否正在获取请求的资源不可用。在Heroku上运行时发出消息?您的Procfile看起来像什么?可能值得在webapp-runner上尝试-expand-war选项。感谢您的回复。我在本地主机上运行时收到此消息。我已经尝试了-expand-war选项,但是没有帮助。当你遇到错误时,你正在访问的URL是什么?另外,根据@joekutner的评论,您的Procfile看起来像什么?
<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>Uzleti.webtechnologiak</groupId>
  <artifactId>Uzleti.webtechnologiak</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <resources>
      <resource>
        <directory>src</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <warSourceDirectory>WebContent</warSourceDirectory>
          <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
      </plugin>
      <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.3</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals><goal>copy</goal></goals>
                    <configuration>
                        <artifactItems>
                            <artifactItem>
                                <groupId>com.github.jsimone</groupId>
                                <artifactId>webapp-runner</artifactId>
                                <version>7.0.40.0</version>
                                <destFileName>webapp-runner.jar</destFileName>
                            </artifactItem>
                        </artifactItems>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>provided</scope>
    </dependency>
  </dependencies>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    id="WebApp_ID" version="3.0">
    <display-name>Projekt</display-name>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
    <servlet-mapping>
        <servlet-name>Projekt</servlet-name>
        <url-pattern>/Projekt</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Init</servlet-name>
        <url-pattern>/Jatek</url-pattern>
    </servlet-mapping>
    <servlet>
        <servlet-name>Vege</servlet-name>
        <jsp-file>/vege.jsp</jsp-file>
    </servlet>
    <servlet-mapping>
        <servlet-name>Vege</servlet-name>
        <url-pattern>/Vege</url-pattern>
    </servlet-mapping>
    <listener>
        <listener-class>MyHttpSessionListener</listener-class>
    </listener>
    <error-page>
        <exception-type>java.io.FileNotFoundException</exception-type>
        <location>/errorpage.html</location>
    </error-page>
</web-app>