You are here

Debugging an Alfresco installation

When developing add-ins, fixing bugs, or changing Alfresco from the source code, it is helpful to debug an instance of Alfresco running on a standard application server. You can configure Alfresco and Eclipse to provide a real-time view of the server and to troubleshoot issues by stepping through the code line by line.

To debug a running Alfresco server, you must connect to the JVM in which Alfresco is running. The following steps configure the JVM to expose an interface for this connection, and then configure Eclipse to connect to and control that JVM.

Configuring the JVM

You can configure the JVM to expose an interface for connection to the Alfresco server.
Before you start, you must:
  • Have a fully installed, configured, and running instance of Alfresco. These steps assume you are using Tomcat on Windows, but the steps are similar for other application servers on other systems.
  • Have an IDE installed. These steps describe how to configure Eclipse, which must be installed first (Eclipse)
  • Download and install the Alfresco source code from Alfresco source code.
  • Ensure the source code is the same version as the installed Alfresco server.
  1. Verify that the Alfresco server is not running.
  2. Edit the JVM options used to start the Alfresco Tomcat instance.

    For example, set the following:

    JAVA_OPTS=%JAVA_OPTS% -server -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8082
    where address is a port for your system.
  3. Save the file and close the editor.

Configuring Eclipse

This task describes how to configure Eclipse to connect to and control the JVM.
  1. From the Run menu, choose the Open Debug dialog.
  2. Right-click Remote Java Application and select New.
  3. In the Name box, type Debug Local Tomcat Alfresco.
  4. Next to Project, click Browse, and select Web Client. If this is not available as an option, ensure your source code matches that of your server.
  5. In Connection Properties, enter the port number.
  6. Check Allow Termination of remote VM if you want to be able to stop the Alfresco server from the Eclipse console.
  7. Click Apply to save the configuration.

Sending feedback to the Alfresco documentation team

You don't appear to have JavaScript enabled in your browser. With JavaScript enabled, you can provide feedback to us using our simple form. Here are some instructions on how to enable JavaScript in your web browser.