my6solutions

asp .net, the social web & other distractions

 

Running Apps

Disclaimer

I am in no way affiliated with Microsoft or Google. I am just another developer trying to make a difference. All opinions and observations are usually my own.

Getting debugging to work on shindig under Windows

The following is based on shindig rev. 698050. We will be using Eclipse 3.4 - Ganymede to enable us to single-step debug the java implementation of shindig. 

First, you'll need to download and install the following tools

  • Download Java SE 6 JDK here
  • Download Eclipse 3.4 for Java Developers here 
  • Download Tortoise SVN here
  • Download Maven 2.0 here
  1. Install the above software and/or JDK
  2. Create a directory somewhere, I called mine c:\temp\shindig

  3. Right-click on the shindig folder, and select "SVN Checkout ...



  4. Enter the URL of the repository as http://svn.apache.org/repos/asf/incubator/shindig/trunk. You can select the Revision as 698050 or choose the latest revision. However,choosing the latest revision may not build properly so you will need to find the latest on that would


  5. Hit OK, sit back and wait while the code downloads.

  6. Ensure that the JAVA_HOME environment variable is set, eg. JAVA_HOME=C:\Sun\SDK\jdk

  7. Once you've installed Maven, you should be able to execute mvn from the source directory of shindig.


  8. Next, execute mvn eclipse:m2eclipse in your shindig base directory


  9. Go to the directory where you have installed Eclipse and open eclipse.ini. Add the following parameter to notify eclipse of the location of the Java JDK


  10. Once done, fire up Eclipse. Go to Help .. Software Updates ... Available Updates and Add Site... and enter http://m2eclipse.sonatype.org/update/. Select ONLY the Maven Integration plugin. Click Install ...


  11. Create a new workspace from File ... Switch Workspace ... Other.. . anywhere would do just not the same directory as the source code that was downloaded.

  12. In Eclipse, import the new project by File .. Import ..  General ... Existing Project and select your shindig root directory, eg.


    Click Finish.

  13. There will be errors. Don't worry. Right click on each project, Build Path ... Configure Build Path ... and remove missing Source folders of "config", and/or "javascript". Do this for
        each of "common", "gadgets", "social-api" and "server" projects. After you do this, the annoying small red "x"s should be gone and all 5 projects will build properly with just warnings.

  14. Finally clean up the project by executing mvn eclipse:clean at the shindig source


  15. To run Jetty from Eclipse, go Run ... External Tools ... External Tools Configuration ... and add a new launch configuration


  16. Add the following changes (based on the shindig source directory of c:\temp\shindig):
    • Name: mvn_jetty
    • Location: C:\Program Files\Apache Software Foundation\apache-maven-2.0.9\bin\mvn.bat
    • Working directory: C:\temp\shindig\java\server
    • Arguments: jetty:run-war
    • Environment variables (depending on the location of your Java JDK and Jetty to run on port 8080):
          JAV_HOME : ${system_path:C:\Sun\SDK\jdk\jre}
          MAVEN_OPTS : -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8080,server=y,suspend=y

  17. To setup the debug configuration. go Run ... Debug Configurations ... and Add a new Remote Java Application


  18. Add the following changes:
    • Name: shindig_debug
    • Project: Browse to and select the 'shindig-server' project
    • Host: localhost
    • Port: 8080
    • Source Lookup Path: Add shindig-common, shindig-gadgets, shindig-server, shindig-social-api

  19. And that's it. To start debugging run mvn_jetty and then mvn_debug

  20. Browse to http://localhost:8080/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml and you should be able to view the todo gadget.
Now, you can single-step through the shindig implementation and have a look see on what makes it tick. Also, when terminating the Jetty server, I have not found a way to terminate it nicely, you will need to kill the java.exe process to do this if you want to restart the Jetty server. I'm sure there's a better way....
Bookmark and Share

Categories: ASP .NET | OpenSocial
Permalink | Comments (0) | Post RSSRSS comment feed