Debugging Vine

Here we present a couple of debugging methods in various IDEs.

Intellij Idea + Tomcat + Gridsphere

In this case we connect to the local Tomcat instance and try to debug Vine using Intellij Idea.

Preparing environment and IDE configuration.

  1. In your environment (i.e. .bash_profile) please add the following variables:

    export JPDA_ADDRESS=1044
    export JPDA_TRANSPORT=dt_socket
     
  2. In the IDE go to the Run->Edit Configurations menu.
  3. Go to the 'Add New Configuration' and choose Tomcat Server->Local

    Intellij Idea + Tomcat + Gridsphere debugIntellij Idea + Tomcat + Gridsphere debug

  4. Configure new Application Server for our debug task:

    Intellij Idea + Tomcat + Gridsphere application serverIntellij Idea + Tomcat + Gridsphere application server

  5. Click Add and select your $CATALINA_HOME location:

    Intellij Idea + Tomcat + Gridsphere application server locationIntellij Idea + Tomcat + Gridsphere application server location

  6. Idea will add all jars from Tomcat like:

    Intellij Idea + Tomcat + Gridsphere application server jarsIntellij Idea + Tomcat + Gridsphere application server jars

  7. Then you need to setup your port number to the value set in the env variable ( JPDA_ADDRESS ) which in our case is 1044:

    Intellij Idea + Tomcat + Gridsphere startup connectionIntellij Idea + Tomcat + Gridsphere startup connection

 
 
Debug phase.

  1. Search for the VineLoginCom clas and set a break point as in the following picture:

    Intellij Idea + Tomcat + Gridsphere breakpoint setIntellij Idea + Tomcat + Gridsphere breakpoint set

  2. Go to the Run->Debug menu option, Tomcat should start and the new window at the bottom should appear:

    Intellij Idea + Tomcat + Gridsphere logs viewIntellij Idea + Tomcat + Gridsphere logs view

  3. Go to your browser type: "http://localhost:8080/gridsphere", setup new user and try to log in to the portal. Portal should freeze. Go to the Intellij Idea to see that debug mode is on and working:

    Intellij Idea + Tomcat + Gridsphere debug snapshotIntellij Idea + Tomcat + Gridsphere debug snapshot