0

Description: I have tried this tutorial, but it does not work for me. My maven app (originally a dynamic web application, converted to maven project) works fine when i deploy it via Eclipse, however if i try to deploy in the git bash via webapp runner, Tomcat says that "The requested resource is not available." I'm running apache-maven-3.2.3.

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/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>

web.xml:

<?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>

What could be the problem? Thank you in advance!

3
  • Are you getting the "The requested resource is not available." message when it's running on Heroku? What does your Procfile look like? It might be worth trying the --expand-war option on webapp-runner.
    – codefinger
    Nov 18, 2014 at 15:32
  • Thanks for response. I'm getting this message when it is running on localhost also. I have tried the --expand-war option, but it does not help.
    – Szityi
    Nov 20, 2014 at 15:26
  • What's the URL you are accessing when you get the error? Also, per @joekutner's comment, what does your Procfile look like?
    – bimsapi
    Dec 10, 2014 at 17:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.