title: Deploy JSP Webapplication on Tomcat7 (via OpenShift with GIT)
body: <p>I have build a web appliation containing a Spring MVC project with a mysql database and a tomcat7 server. This is now published to GIT of OpenShift.
  But starting the server takes only 160ms and I can clearly see nothing is being loaded really.</p>
  
  <p>How do I do a real deployment and connect the Openshift Tomcat to my project?
  I can code, but deployment-wise I am not a smart bulb.</p>
  
  <p>My GIT repository looks like this:
  <a href="https://i.stack.imgur.com/ucd5q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ucd5q.png" alt="GitPicture1"></a></p>
  
  <p>What is wrong?</p>
  
  <p><strong>EDIT:</strong>
  As requested the pom.xml:</p>
  
  <pre><code>&lt;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"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.afterguard&lt;/groupId&gt;
    &lt;artifactId&gt;SailPlanner&lt;/artifactId&gt;
    &lt;version&gt;0.8.0&lt;/version&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
    &lt;/properties&gt;
    &lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;openshift&lt;/id&gt;
          &lt;build&gt;
              &lt;finalName&gt;sailplanner&lt;/finalName&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.6&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;outputDirectory&gt;webapps&lt;/outputDirectory&gt;
                          &lt;warName&gt;ROOT&lt;/warName&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/build&gt;
      &lt;/profile&gt;
    &lt;/profiles&gt;
    &lt;build&gt;
      &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.3&lt;/version&gt;
          &lt;configuration&gt;
            &lt;source&gt;1.7&lt;/source&gt;
            &lt;target&gt;1.7&lt;/target&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.6&lt;/version&gt;
          &lt;configuration&gt;
            &lt;warSourceDirectory&gt;WebContent&lt;/warSourceDirectory&gt;
            &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
          &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-aop&lt;/artifactId&gt;
          &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
          &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
          &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
          &lt;version&gt;3.0.1&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;jstl&lt;/artifactId&gt;
          &lt;version&gt;1.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;commons-logging&lt;/groupId&gt;
          &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
          &lt;version&gt;1.1.3&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;version&gt;5.1.9&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
          &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
          &lt;artifactId&gt;gson&lt;/artifactId&gt;
          &lt;version&gt;2.3.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-web&lt;/artifactId&gt;
          &lt;version&gt;4.0.2.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-config&lt;/artifactId&gt;
          &lt;version&gt;4.0.2.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-taglibs&lt;/artifactId&gt;
          &lt;version&gt;4.0.2.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-crypto&lt;/artifactId&gt;
          &lt;version&gt;4.0.2.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
          &lt;version&gt;4.1.6.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j&lt;/artifactId&gt;
          &lt;version&gt;1.2.17&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.openshift&lt;/groupId&gt;
          &lt;artifactId&gt;openshift-java-client&lt;/artifactId&gt;
          &lt;version&gt;2.7.0.Final&lt;/version&gt;
      &lt;/dependency&gt;
  
    &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>The <code>web.xml</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
              xmlns="http://java.sun.com/xml/ns/javaee" 
              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
              version="3.0"&gt;
    &lt;display-name&gt;SailPlanner&lt;/display-name&gt;
  
    &lt;welcome-file-list&gt;  
      &lt;welcome-file&gt;/WEB-INF/jsp/index.jsp&lt;/welcome-file&gt;  
    &lt;/welcome-file-list&gt;  
  
    &lt;servlet&gt;
      &lt;servlet-name&gt;sailplanner&lt;/servlet-name&gt;
      &lt;servlet-class&gt;
              org.springframework.web.servlet.DispatcherServlet
          &lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;
  
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;sailplanner&lt;/servlet-name&gt;
  &lt;!--     &lt;url-pattern&gt;/&lt;/url-pattern&gt; --&gt;
      &lt;url-pattern&gt;/index&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/inside/admin&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/inside/admin/save&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/inside/admin/delete&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/inside/calendar_race&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/inside/calendar_cruise&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/inside/blog&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/inside/blog/submit&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/inside/blog/delete&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/inside/event_feed&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/inside/event/create&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/inside/event/delete&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/inside/event/crew/add&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/inside/event/crew/remove&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/inside/event/save&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/login&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/logout&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/403&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/registration&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/inside/yacht/create&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  
    &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
    &lt;/listener&gt;
  
    &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;
              /WEB-INF/sailplanner-servlet.xml,
              /WEB-INF/spring-security.xml,
              /WEB-INF/spring-database.xml
          &lt;/param-value&gt;
    &lt;/context-param&gt; 
  
          &lt;!-- Spring Security --&gt;
      &lt;filter&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>Git Push Log (of successful build):</p>
  
  <pre><code>Repository ssh://566ffc920c1e668c8a000049@afterguard-sailplanner.rhcloud.com/~/git/afterguard.git/
  
  Stopping jbossews cartridge
  Sending SIGTERM to jboss:333213 ...
  Stopping MySQL 5.5 cartridge
  Stopping PHPMyAdmin cartridge
  Waiting for stop to finish
  Waiting for stop to finish
  Repairing links for 1 deployments
  Building git ref 'master', commit 277c797
  Using Maven mirror /var/lib/openshift/566ffc920c1e668c8a000049/app-root/runtime/repo//.openshift/config/settings.rhcloud.xml
  Apache Maven 3.0.4 (r1232336; 2012-12-18 14:36:37-0500)
  Maven home: /usr/share/java/apache-maven-3.0.4
  Java version: 1.7.0_91, vendor: Oracle Corporation
  Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91/jre
  Default locale: en_US, platform encoding: ANSI_X3.4-1968
  OS name: "linux", version: "2.6.32-573.12.1.el6.x86_64", arch: "i386", family: "unix"
  Found pom.xml... attempting to build with 'mvn --global-settings /var/lib/openshift/566ffc920c1e668c8a000049/app-root/runtime/repo//.openshift/config/settings.rhcloud.xml clean package -Popenshift -DskipTests'
  [INFO] Scanning for projects...
  [INFO]                                                                         
  [INFO] ------------------------------------------------------------------------
  [INFO] Building SailPlanner 0.8.0
  [INFO] ------------------------------------------------------------------------
  Downloading: http://maven.repository.redhat.com/techpreview/all/javax/servlet/javax.servlet-api/3.0.1/javax.servlet-api-3.0.1.pom
  
  ...A LOT OF BUILDING AND DOWNLOADING...
  
  Downloaded: http://mirror.ops.rhcloud.com/nexus/content/groups/public/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar (422 KB at 6105.7 KB/sec)
  [INFO] Packaging webapp
  [INFO] Assembling webapp [SailPlanner] in [/var/lib/openshift/566ffc920c1e668c8a000049/app-root/runtime/repo/target/sailplanner]
  [INFO] Processing war project
  [INFO] Copying webapp resources [/var/lib/openshift/566ffc920c1e668c8a000049/app-root/runtime/repo/WebContent]
  [INFO] Webapp assembled in [517 msecs]
  [INFO] Building war: /var/lib/openshift/566ffc920c1e668c8a000049/app-root/runtime/repo/WebContent/ROOT.war
  [INFO] WEB-INF/web.xml already added, skipping
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 21.062s
  [INFO] Finished at: Tue Dec 22 05:35:45 EST 2015
  [INFO] Final Memory: 16M/161M
  [INFO] ------------------------------------------------------------------------
  Preparing build for deployment
  Deployment id is 0f103f85
  Activating deployment
  Starting MySQL 5.5 cartridge
  Starting PHPMyAdmin cartridge
  Starting jbossews cartridge
  Found 127.3.145.129:8080 listening port
  -------------------------
  Git Post-Receive Result: success
  Activation status: success
  Deployment completed with status: success
  </code></pre>
  
  <p>Tomcat log of OpenShift:</p>
  
  <pre><code>Dec 22, 2015 6:47:27 AM org.apache.catalina.startup.Catalina load
  INFO: Initialization processed in 1503 ms
  Dec 22, 2015 6:47:27 AM org.apache.catalina.core.StandardService startInternal
  INFO: Starting service Catalina
  Dec 22, 2015 6:47:27 AM org.apache.catalina.core.StandardEngine startInternal
  INFO: Starting Servlet Engine: Apache Tomcat/7.0.54
  Dec 22, 2015 6:47:27 AM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["http-bio-127.3.145.129-8080"]
  Dec 22, 2015 6:47:27 AM org.apache.catalina.startup.Catalina start
  INFO: Server startup in 251 ms
  </code></pre>
  
  <p>File Structure of ROOT.WAR, which is located in <code>/var/lib/openshift/&lt;uuid&gt;/app-root/runtime/repo/WebContent</code> :</p>
  
  <pre><code>|- META-INF
  |- resources
  |-- css
  |-- fonts
  |-- img
  |-- js
  |- WEB-INF
  |-- classes
  |--- com
  |---- ...
  |-- jsp
  |--- index.jsp
  |--- more jsp-sites
  |-- jspf
  |--- JSPF SITES I USE
  |-- lib
  |--- THE LIBS
  |-- sailplanner-servlet.xml
  |-- spring-datasource.xml
  |-- spring-security.xml
  |-- web.xml
  </code></pre>