Debugging D2 4.5/4.6

It still surprises me when people tell me that they can “only” debug D2 code by adding output to their plugins so, if you’re using eclipse as your IDE, here are some steps that most likely will help you to debug code from an eclipse server (Tomcat):

Extract all files from D2.war and D2-Config.war (just in case you want to have access to D2-Config from a local environment, not much you can debug here) and copy the D2 lib folder to your computer.

  • Generate lockbox file for your environment (probably this is the hardest part :D)
  • Update dfc.properties in both.
  • Update D2’s D2FS.properties (update absolute path in lockboxPath) and logback.xml (update logs path)
  • Update D2-Config’s D2-Config.properties (update absolute path in lockboxPath) and logback.xml (update logs path)
  • Copy following libraries to Tomcat folder:
    • /endorsed: (from d2-config/web-inf/lib)
      • crypto.jar
      • cryptojce.jar
      • cryptojcommon.jar
      • jcm.jar
      • jcmandroidfips.jar
      • jcmFIPS.jar
      • util.jar
    • /lib:
      • LB.jar
      • LBJNI.jar
  • Configure a new server in eclipse. In Run Configuration add the following:
    • Arguments:
      • -Djava.endorsed.dirs=”<absolute path to tomcat>\endorsed
      • -Djava.io.tmpdir=”<absolute path to some temp folder>\d2″
      • -Dclb.library.path=”<absolute path to D2 libraries folder>\lockbox\win_vc100_x64″ (choose your OS library)
    • Classpath:
      • User entries:
        • Path to LB.jar and LBJNI.jar
      • Environment:
        • Classpath: <absolute path to D2 libraries folder>\LB.jar;<absolute path to D2 libraries folder>\LBJNI.jar;<absolute path to D2 libraries folder>\C6-Common.jar;<absolute path to Documentum DFC’s dctm.jar>;<absolute path to Documentum config folder>
        • Path: <absolute path to D2 libraries folder>\lockbox\win_vc100_x64;%PATH%
    • Add project to Sources
  • Add D2 and D2-Config as deployed modules to your server configuration.
  • Start server

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s