Debugging in Cloudsoft AMP
Karaf can be started in debug mode with:
You can then connect to port 5005 using your normal Java debugger.
If you want to change dt_socket port you can pass JAVA_DEBUG_PORT
environment variable
To pause startup until the debugger is connected you can use
For other options please check your JVM JPDA documentation. Hotspot JPDA: https://docs.oracle.com/javase/8/docs/technotes/guides/jpda/
Start the AMP server in the background using the following command
The Karaf container will keep state such as installed bundles and configuration between restarts. To reset any changes add clean to the CLI arguments.
Using Java Remote Debug when Cloudsoft AMP is installed from an .rpm (Not Recommended)
With RPM it is pretty much the same however there are a few things you have to prepare.
- Export variables set in
/lib/systemd/system/amp.service
. Variables which are by default there.export KARAF_HOME=/opt/amp KARAF_ETC=/etc/amp AMP_PERSISTENCE_DIR=/var/lib/amp
cd /opt/amp
sudo -u amp -E /opt/amp/bin/karaf debug
- As mentioned in previous paragraph use
JAVA_DEBUG_OPTS
to set additional options like block Java startup until debugger is attached.