Making Spring Tool Suite generated web app work on standalone Tomcat server

23,438

STS/Eclipse use a complete different (lets call it) "working directory" for tomcat.

If you want to run your application without STS/Eclipse, than let STS/Eclipse or Mave create a war file for your project.

  • for maven it is: mvn package - it creates a war file in the target folder
  • for STS+Maven it is: Project/Run as.../Maven Package
  • for Eclipse without Maven: Project/Export/Web/WAR file

Then you need to copy this war file into the webapps folder of your ORIGINAL tomcat installation (NOT the folder .metadata/plugins/org.eclipse.wst.server.core... within your eclipse workspace direcory)

Share:
23,438
prosseek
Author by

prosseek

A software engineer/programmer/researcher/professor who loves everything about software building. Programming Language: C/C++, D, Java/Groovy/Scala, C#, Objective-C, Python, Ruby, Lisp, Prolog, SQL, Smalltalk, Haskell, F#, OCaml, Erlang/Elixir, Forth, Rebol/Red Programming Tools and environments: Emacs, Eclipse, TextMate, JVM, .NET Programming Methodology: Refactoring, Design Patterns, Agile, eXtreme Computer Science: Algorithm, Compiler, Artificial Intelligence

Updated on January 23, 2020

Comments

  • prosseek
    prosseek over 4 years

    From Deploying spring web apps using Spring Tool Suite question, I could build and deploy spring web application with Spring Tool Suite. I could access the app at localhost:8080/manolitomvc.

    enter image description here

    Shutting down the Spring Tool Suite Tomcat server, I relaunch Tomcat with sudo startup.sh, but I got this error message.

    enter image description here

    What's wrong? What server setup is necessary for making manolitomvc app to work?

    ADDED/SOLVED

    Based on Ralph's answer, I could make it work.

    In STS workspace directory, I could generate the war file in Tomcat directory.

    enter image description here

    Copying the war file in the web apps make the deployment work. Interestingly, the manolitomvc directory is generated automatically with the action of copying.

    enter image description here

    Or, you can just set the destination to the webapp directory.

    enter image description here