Sunday, June 28, 2020

Set up and Debug using a Tomcat Web Server and Eclipse IDE

Have you been looking to debug and run your web app in a Tomcat web server in Eclipse so you can set break points and inspect the call stack? You've come to the right guide. This guide will cover setting up a Tomcat web server in Eclipse. 

Download Eclipse IDE 
When working with the Eclipse Web Standard Tools (WST), I recommend downloading the latest Enterprise version. 

Note: If you're an expert, you can install the plugins separately. If you have an existing Eclipse and projects config, I find it's much easier to download a new version of Eclipse. And open back up the previous workspace. 

The Eclipse installer, choose the 'Eclipse IDE for Enterprise Java Developers'.  


Download Apache Tomcat
Download the latest Apache Tomcat, which means you download the web server code that can runs the Apache Tomcat web server. 

  1. Download the latest Apache Tomcat. Go to the downloads, then choose the core zip. 
  2. Unzip the core zip into a memorable directory. For example ~/servers/tomcat/apache-tomcat-x.x.xx.



Install the Tomcat Server
The goal is to add the Server in the Eclipse Servers list. And then it can be used to add a project to it. 

1. Open Eclipse
2. Go to the Debug Perspective. Window Menu > Open Perspective > Debug
3. Click on the 'Servers' view or looks like a tab. 
4. Click on the 'No servers are available...', this will open the 'Define a New Server' dialog. 
5. Filter the server type, 'tomcat'. 
6. Select the Tomcat server version you downloaded earlier. I selected Tomcat v9.0 Server.
7. Clicking next will bring you to the Tomcat Installation directory choice. Choose the install directory. This directory points to the unzipped files that were downloaded earlier. For example select ~/servers/tomcat/apache-tomcat-x.x.xx. Select next.
8. Add and Remove, this will allow you to add your WST web app. This can be done later too.
9. Click finish, and you have a new Tomcat Server to use with web app debugging.


Debugging
Once the server has been added, you can add your project with a web app folder to the server.  The applications web app can be added during server install or after. 

1. After the server is added, right click on server and click Add and Remove...
2. Select your project and add it to the server. 

Example of Installing the server and adding your project to it. Then running the server in debug mode. 






2 comments:

Anonymous said...

Best Baccarat Games In New Jersey | William Hill
Online Baccarat games can be played from 바카라 사이트 anywhere 인카지노 in New Jersey. The real deal is that the minimum bet is $10, and the septcasino

ligawd said...

That is the fitting blog for anyone who desires to seek out out about this topic. You realize a lot its virtually onerous to argue with you (not that I truly would need…HaHa). You definitely put a new spin on a topic thats been written about for years. Nice stuff, simply great! programar en java

Trying out the Dart Analysis Server

I wanted to see how the Dart Analysis Server was put together and worked. I started looking to see how I could wire it up and try out the co...