Best way to debug Java web application packaged as a WAR using Eclipse and Maven?
If you run your WAR with tomcat/jetty plugin pass debug options to the Maven:
export MAVEN_OPTS="-Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000" mvn tomcat:run
If you run your WAR using the regular Tomcat, just run it with JPDA (debugger) support enabled:
$TOMCAT_HOME/bin/catalina.sh jpda start
Default port for Tomcat 6 JPDA is 8000.
Now connect with the Eclipse (Debug -> Remote Java Application) to the port 8000 and enjoy your fine debugging session.
Work on a remote project with Eclipse via SSH
Try the Remote System Explorer (RSE). It's a set of plug-ins to do exactly what you want.
RSE may already be included in your current Eclipse installation. To check in Eclipse Indigo go to Window > Open Perspective > Other... and choose Remote System Explorer from the Open Perspective dialog to open the RSE perspective.
To create an SSH remote project from the RSE perspective in Eclipse:
- Define a new connection and choose SSH Only from the Select Remote System Type screen in the New Connection dialog.
- Enter the connection information then choose Finish.
- Connect to the new host. (Assumes SSH keys are already setup.)
- Once connected, drill down into the host's Sftp Files, choose a folder and select Create Remote Project from the item's context menu. (Wait as the remote project is created.)
If done correctly, there should now be a new remote project accessible from the Project Explorer and other perspectives within eclipse. With the SSH connection set-up correctly passwords can be made an optional part of the normal SSH authentication process. A remote project with Eclipse via SSH is now created.
how can I use eclipse to debug a libtool generated script?
Running a script instead of an executable is still unsupported in Eclipse, see this bug. Until the feature is introduced, you cannot debug a libtool-enabled project under Eclipse unless you keep something like a
path/to/configure --disable-shared
separate configuration, thus relying on static linking only for debugging purposes.
To do that, you
Open
Project|Properties
from the top menuSelect
Autotools|Configure Settings
from the left menu of the window(Optionally) Create a new build configuration with a dedicated
C/C++ Build|Builder Settings|Build location
Under
configure|Advanced
, fill the "Additional command-line options" with--disable-shared
Related Topics
Recording from Alsa - Understanding Memory Mapping
Prevent Fork() from Copying Sockets
Running R in Batch Mode on Linux: Output Issues
How to Use Ptrace(2) to Change Behaviour of Syscalls
How to Find All Image Tags of a Running Docker Container
How to Stop Sed from Buffering
How to Disable Tcp Slow Start in Linux
Atomically Swap Contents of Two Files on Linux
Change Owner of a Currently Running Process
Exploiting a String-Based Overflow on X86-64 with Nx (Dep) and Aslr Enabled
How to Use Awk to Test If a Column Value Is in Another File
Force Netcat to Send Messages Immediately (Without Buffering)
Make Bash Differentiate Between Ctrl-<Letter> and Ctrl-Shift-<Letter>
Diff Files Inside of Zip Without Extracting It