At first I thought, I really do not understand why you ran into a problem. Perhaps the path laid by Eclipse is too confusing and confusing.
In my Eclipse, I used the default jetty as a server while debugging GWT. However, there were some problems that were not caught by the pier when deploying to Tomcat or JBoss.
And when I added Tomcat or JBoss instances to Eclipse and added my application to these server instances, debugging worked right away. Are you missing one piece of vital but simple information?
Let me assume that the following will fill in your missing link ...
Search / add server instance:
In the Package Explorer (or Project Explorer, any of them) in Eclipse, you will see, in addition to your personal projects, the "servers" project. Below it are the configuration nodes listing all your Tomcat instances.
If you do not see the “servers” node in the package explorer, this is probably due to your working set filter. (And if you don’t know which working sets ... I think you will need to strengthen your agility in Eclipse).
If you do not already have an instance of Tomcat, you simply right-click on the “servers” project to add a new server (Package Explorer → New → Server ...). You will be asked to indicate the location of your Tomcat home. And your desired server instance port number. Of course, you will need to make sure that the port number will not conflict with the port used by any other inet operation in your field.
2nd port number setting
In the node server instance in Package Explorer, you will find a file that you must modify to set the port number to match the one you specified when creating the new Tomcat instance. If you do not know which file to edit, you will need to read the version of Tomcat that you created to find out which file contains the port number configuration.
You need to configure the port 2 times, because for the first time it tells Eclipse where and in which port to expect the server instance to be started. The second time is to configure the server instance itself.
Adding your application to the server
However, the nodes in the servers project allow you to configure Tomcat instances. There is another view called “server view” for further configuration of the tomcat instance. You need to enable the "Server" view from the window "> Show View"> "Server-> Servers".
Right-click on the server instance in "Server View" to add your application.
Running debugging with a created Maven target.
There are times when you want to debug a military structure to find out which banks are missing in the war. And gradually remove the banks from your war to find out the banks that are already supplied by the server. Since JBoss already ships many of the jars, you will need to find out if your development matches the version banks expected by JBoss.
You would create another Eclipse project in your workspace and make a soft link for the Eclipse folder in the second project to indicate the purpose of your first project created by Maven. And you specify target / {maven generated webapp directory} as the webapp directory of your second project. What I mean by “maven-created Webapp directory” is the unpacked intermediate directory generated by Maven (used by Maven to generate the zipper file).
This is the cleanest way to debug a production war if you can accurately reproduce the tomcat / jboss production server in your Eclipse development block.
If you prefer JBoss.
Somehow, the configuration of the JBoss node is not listed in the "Servers" section of the node in Package / Project Explorers. You will need to go to the JBoss installation directory to edit them.
Remote debugging.
If you want to debug the application in your production box or on a server sitting in another field, you will need to run this tomcat instance under debugging. You must read this. You must specify a debug port.
Then in Eclipse, under Start> Debug Configuration → Remote Java Application, you specify the application and debug port.
When debugging for the first time, Eclipse “may not know” where the source files are, especially if your application has several project dependencies. (Why can't Eclipse search for source files from my list of projects?) In any case, you need to specify where to search for source files. And then, when your debugging goes into another project dependency, you will have to rewrite the location of the source files.
So voila! This is how I got the debugging work. I advise you to avoid remote debugging as much as possible if you do not need to diagnose production problems. If you are not performing remote debugging, do not try to deploy the war on a local server, but simply depend on combining the project with the server instance.
Eclipse is too confusing
I know that Eclipse is too confusing, and you should skip its features. You just need to carry it. Eclipse's menus and views appear to be optimized for a plug-in oriented non-user oriented programmer.
For example, why should I “help” install new software? I used to expect Help-> Install new software to become a tutorial on installing new software.
It hits (and annoys me) that the Eclipse team did not combine operations so that I could add applications to the server instance in Package Explorer. Why not? As a user, I expect to see only one entry point to configure my servers.
To ease confusion, I like to encourage people to download and install the Eclipse (STS) Springsource version. This is the same Eclipse, except that the STS has the necessary parts and has a panel indicating compatible plugins that are installed. Tomcat is preinstalled as a VMware tc server. And the views are correctly config'd to show server instances. And pre-installed the installed Eclipse-Maven plugin.
source share