wissel.net

Usability - Productivity - Business - The web - Singapore & Twins

Lessons in Domino, Java, Eclipse and Tomcat.


Today was debugging day. DominoDAV is progressing and it looks like I can keep my promise to have the first version up this month. There are a few lessons to learn when debugging in Eclipse. I'm using Eclipse 3.1.2, Oxygen XML Editor plug-in and MyEclipseIDE as my main tools (for a complete list see my previous post). Since there are quite a number of plug-ins active, Eclipse is not exactly fast. Until you give it some breathing space. By default the memory constraint is set to 40-128 MB for the Eclipse JVM. Running a PC with 1.5G this seemed a little low. In the Eclipse directory there is the eclipse.ini file where you can adjust this setting. It is now 256-512 and Eclipse 4-6 times faster (measured totally unscientific).
When debugging nobody used System.out.println(...) anymore. Being 21st century people we use Log4J. The only drawback: It wouldn't work in Tomcat 5.5. After experimenting for a while and sniffing online I found the solution: You need to put the log4j.jar AND the commons_logging.jar (even if you never actually touch the content of the later) into the WEB-INF\lib directory. This opens the possibility to even remotely see the debug result using Chainsaw. When deploying to Websphere 6 you don't seem to need the commons_logging.jar, at least it was working here without it.
To get Notes working you need to have your Notes executable on the systems path and need to copy the jar files (Notes.jar for local access, NCSO.jar for Corba access) into the {tomcat-root}\common\libs directory. This is required, since the native libraries (a.k.a. DLLs) can be loaded only once. While there your Notes.jar can make friends with the Oracle or SQL Server jars, since they live in the same place.
Finally: When you launch Tomcat from the debugger (a nice feature of MyEclipseIDE, but also available in free plug-ins) it will ignore the path of your machine. So you are in for all the mysterious "Unsatisfied Link errors". In MyEclipseIDE there is a special setting "Library Include Path" for every server to configure. There you point to your Notes or Domino program directory and you are all set.
Finally: debugging multithread is not really fun. Since remote Notes call run in their own thread you have to take care of that. I really hope Bob is releasing (as promised considered during Lotusphere 2006) his pool manager as OpenSource soon.

Posted by on 07 February 2006 | Comments (1) | categories: IBM Notes Lotus Notes

Comments

  1. posted by Gana on Saturday 11 February 2006 AD:
    Thanks for your tip on eclipse.ini. I'm using 3.1.1 and it was 40 to 256 by default. I changed it to 220 to 256 and its really fast (unscientific measure again).