• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to use Tomcat as external Server for Spring-Boot Web app ?

 
Ranch Hand
Posts: 1021
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi expert,

I would like to know what is the right way to deploy my compiled/generated SpringBootWebApp.war to Tomcat for deployment ?

The following tutorial :

https://www.surasint.com/spring-boot-create-war-for-tomcat/

indicated that I need to copy the war to my Tomcat WebApp's folder and then renamed the .war to Root.war which I did so.

Please see attached.

But, when I start my Tomcat server, it just gives me this error :

Server Tomcat v8.5 Server at localhost failed to start.

(Note: I have deleted Tomcat many times and installed new instances)

So, I hope someone can tell me how to make Tomcat server deploy my web just like the tutorial ?

Many thanks.

Tomcat-not-starting.jpg
[Thumbnail for Tomcat-not-starting.jpg]
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The "Boot" in Spring Boot refers to the fact that when you build a Spring Boot app, it has a copy of Tomcat (or a similar webapp server) already embedded in the project itself, ready to run the app.

If you've got a WAR file build from that project and you don't want it self-booting, then the Spring Boot part of the project doesn't really matter. Just the WAR itself.

There are many ways to deploy a WAR into Tomcat - too many to describe here, but the Tomcat docs do a good job of doing so. The idea of copying your Spring Boot project's WAR in and renaming it to Root.war is one option, although not the one I prefer myself. Apparently, however, Tomcat had a major problem starting up for you, either because there's something wrong with the WAR or something wrong with how you are trying to run Tomcat (for example, another copy of Tomcat might already be running on that machine).

There are 2 log files that Tomcat usually produces that can help you find out more. One is the TOMCAT_HOME/logs/catalina.out file and the other is the TOMCAT_HOME/logs/localhost  log file (its exact name varies). The localhost log usually shows errors that happen during the early startup and catalina.out shows errors once the majors tomcat subsystems are up and running and Tomcat starts and runs the webapps.

For us to be able to tell you what's wrong, we need to see what those files look like.
 
tangara goh
Ranch Hand
Posts: 1021
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:
Tomcat (for example, another copy of Tomcat might already be running on that machine).

There are 2 log files that Tomcat usually produces that can help you find out more. One is the TOMCAT_HOME/logs/catalina.out file and the other is the TOMCAT_HOME/logs/localhost  log file (its exact name varies). The localhost log usually shows errors that happen during the early startup and catalina.out shows errors once the majors tomcat subsystems are up and running and Tomcat starts and runs the webapps.

For us to be able to tell you what's wrong, we need to see what those files look like.



I checked my log file but there was nothing on that date and I got this below.

eclipse.buildId=4.7.3.M20180330-0640
java.version=1.8.0_171
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

org.eclipse.jst.server.tomcat.core
Error
Tue May 29 00:02:48 SGT 2018
The Tomcat server configuration at \Servers\Tomcat v8.5 Server at localhost-config is missing. Check the server for errors.

What is causing the log to be missing ?

 
Tim Holloway
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like you aren't just trying to run Tomcat, but you are trying to run Tomcat under the Eclipse IDE using the J2EE Eclipse plugin.

WTP is horrible. It mangles Tomcat's configuration by making an incomplete (and often outdated) copy of the Tomcat config files and uses this awful substitute to run Tomcat. I avoid it and use the sysdeo/mongrel plugin myself, which uses the actual Tomcat configuration.

If you were planning to run your Spring Boot app under Tomcat just so you could use the debugger, consider using Remote Debugging instead. The Remote Debugging feature is built into the JVM and the Eclipse debugger can connect to it easily. So you can debug your Spring Boot app without the extra overhead of running an external Tomcat. Come to think of it, you should be able to run the Spring Boot app as a Java Application in its own right under the Eclipse debugger and not have to deal with the remote debug system directly at all.

I'm linking this thread to the Eclipse forum, since most of your problems seem more Eclipse-related than Tomcat-related.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic