Discovering Notes 8: VMWare, Notes 8 and database corruption


For quite some time I have been a strong proponent of using VMWare for customer development. I used to have 2 or 3 Notes clients in various versions installed on my laptop with a directory pointer per customer linked into my main data directory. A little over a year ago I switched to using VMWare Workstation instead for all development. This setup worked out great for me.

Some customers had their own VMWare images and some customers shared a VMWare image. This also worked out great. Once Notes 8 was released I moved my Notes 7.0.2 installation into a VMWare image with a directory pointer to my “external” Notes data directory. With “external” I mean outside the VMWare image OS. This works out great when running Notes 7.0.2 or earlier outside the VMWare image but once I upgraded to Notes 8 the problems started. I started experiencing database corruption issues of my mail database which I of cause access from both inside and outside VMWare.

After diagnosing these issues I came the conclusion that this kind of setup just isn’t supported with Notes 8 part of the mix. Therefore I have split my shared Notes data directory into two parts; a customer part which is accessible from inside VMWare and a production part which is only accessible from Notes 8 outside VMWare. This has solved the database corruption issues.

While sharing directories linked in with directory pointers between running Notes instances has probably never been officially supported it used to work and now doesn’t. I just thought I would share.

Afterwards I have changed my setup again and moved completely to VMWare for development. In the new setup I have one or two VMWare images per customer (one for Notes and one for Domino) on an external USB drive with the correct Notes/Domino versions installed. This works great and has really simplified development and testing for customers.

Why patching the org.apache.commons.lang plugin is necessary

As part of the core Lotus Expeditor framework a number of Apache Jakarta Commons libraries are supplied as plugins. Unfortunately the org.apache.commons.lang plugin is incorrectly packaged which means that developers cannot reuse code from this library. This goes for all Notes 8 releases so far (Notes 8.0, 8.0.1, 8.0.2 beta 1, 8.0.2 beta 2, 8.5 beta 1).

The problem is that the plugin manifest file (MANIFEST.MF) doesn’t export all the packages of the library but only the root package. The *right* thing would be to export all the packages (e.g. org.apache.commons.lang.exception, org.apache.commons.lang.math etc.)

Luckily the problem is quite easy to fix and it will be in upcoming releases. For now, as a developer, the easy way to solve the problem is to simply modify the manifest by unzipping the plugin, changing the MANIFEST.MF file and rezipping the plugin back up. I have done this on all my machines and will be supplying a patched version of the plugins so you can run TwitNotes 1.0.5 on these releases.

Patching this plug-in wont affect other code in my eyes.

Possibly a fantastic tool for Notes 8 education

Last night I stumbled over an amazing article on the developerWorks site and it’s just fantastic. Not that the articles normally aren’t good but this article introduce a Lotus Expeditor tool that could prove invaluable for many Notes 8 shops for use in Notes 8 training or for use in Notes 8 plug-in development. Although the tool was written for Lotus Expeditor it installs just fine under Notes 8.0.1 without any problems at all.

The tool is called the Personal Wizard plug-in and is, from what I can see, developed by Vittorio Castelli from IBM. The tool allows you to record user interface interactions in the Lotus Expeditor/Notes 8 client and play the interactions back. Either by you or by another person you send the procedure. You can also save/load procedures to/from the filesystem.

In this way the tool can be used to automate test procedures and as a way to create end-user education. The tool allows you to step through a procedure (useful for education) or run it as a macro which is useful for development/testing. The tool is a little rough around the edges but it is definitely worth a look.

Using the Personal Wizards plug-in in IBM Lotus Expeditor

SWT@Notes 8: Logging from SWT components

As you probably know using System.out.println for logging in Java is a no-no and this is also the case when developing plugins for Notes 8 and Lotus Expeditor. This post outlines how to use the logging framework supplied with Lotus Expeditor, how to manage the logging and where the logs go.

You have probably been using log4j or similar logging framework for years. Avoiding writing to System.out is even more important when writing SWT components and plug-ins for Notes 8 a.k.a. Eclipse since the output goes to a log tucked away under the covers. Luckily there’s an approach which is so much better and more flexible.

Logging basics

Luckily logging has been built into the language (since Java 1.4) and into the Lotus Expeditor platform. Actually there is 5 different frameworks built into the Lotus Expeditor platform. Based on advise from the Lotus and personal experience I really recommend you use the java.util.logging framework built into the core Java language. This is also known as JSR47 loggers. The below graphics shows the logging sub-system of Lotus Expeditor.



Page 8 from the
IBM Lotus Expeditor 6.1 Client for Desktop Serviceability – Logging and IBM Support Assistant (PDF).

As you can see from the above you can use the following logging frameworks in Lotus Expeditor:

  • Eclipse Logging
  • OSGi Logging
  • IBM Commons Logging
  • Apache Jakarta Commons Logging
  • java.util.logging a.k.a. JSR47

I haven’t got experience with all of the these frameworks and luckily I don’t have to. I just have to know about java.util.logging and there’s an abundance of info on that on Google. The Sun tutorial might be the best place to start if you’ve never used java.util.logging. All this being equal the frameworks work the same with the only difference being how you obtain loggers and what the different logging levels are called. Log levels are called something different in the different frameworks but slide 7 in the Lotus Expeditor documentation on logging shows the mapping between the different frameworks.

Using loggers in code

Using java.util.logging in code is really easy and consists of 3 steps:

  1. Obtain the logger to use (normally in a static final variable).
  2. Write info to the logger.

The below is an example of using loggers.

package com.example.logging;

import java.util.logging.Logger;

public class MyLoggingClass {
   // logger
   private final Logger log = Logger.getLogger(
      this.getClass().getPackage().getName());

   public MyLoggingClass() {
      log.finest("Finest...");
      log.finer("Finer...");
      log.fine("Fine...");
      log.info("Info...");
      log.warning("Warning...");
      log.severe("Severe...");
   }
}

The above code creates a logger in a variable called “log” as a private variable. The logger itself is called com.example.logging which is the name used to control the log level (see below). I find it best to name the logger after the package name that contains the class. Sometimes it is however beneficial to also have a logger with more specialized names to log info on specific events.

Configuring the logger log levels

The log level for a single logger or multiple loggers can be controlled using the LogManager using the <Notes data directory>/workspace/.config/rcpinstall.properties file. To change the log level for the com.example.logging logger to FINEST add the following line to the file and restart the client:

com.example.logging.level=FINEST

To change the level dynamically use the OSGi console commands as described below.

Interacting with loggers from the OSGi console

If you start the Notes 8 client with the OSGi console visible you can interact directly with the loggers using the console command called setlogrlev. To set the log level for the com.example.logging logger to FINEST use the following command:

setlogrlev com.example.logging FINEST

Please note that the logger levels are case sensitive so you have to write “FINEST” and not “finest”.

Where the logging goes

All log messages are written to log files in the <Notes data directory>/workspace/logs directory. Opening the directory will reveal a number of files. The two most important are error-log-X.xml and trace-log-X.xml. The file names are quite explanatory and are, as the extension implies, XML-files. When you open them they’ll be rendered using a XSLT stylesheet to be displayed nicely. You can either read them using a browser or using the “Help/Support/View Log” and “Help/Support/View Trace” menu item in the Notes 8 client.

While the log files are usable I personally find it much easier and better to use the OSGi console when developing as I can adjust the log levels on the fly.

Further reading

TwitNotes – OSGi console commands

I’m continuing to improve TwitNotes and to make it a killer demo application for Notes 8. Last night I added OSGi console commands so you can interact with the application from the OSGi console running underneath Notes 8. Thanks for Bob Balfe from IBM for sharing info on how to do this.

The example in this case is a little far fetched but it serves the point of demoing some of the capabilities you have with the platform.

SWT@Notes 8: -console

As partly addressed by Bob Balfe there are numerous ways to debug Eclipse/SWT components in Notes 8 or Lotus Expeditor. One is as Bob mentions to launch the client using the -console switch so the OSGi console is displayed. While confusing at first the OSGi console is really your friend when developing applications. From the console you have direct access to the OSGi subsystem of Eclipse. But it isn’t just for the Eclipse stuff. Since some Notes 8 components such as the property broker and topology manager have console commands you can interact with them from the console when troubleshooting/debugging.

To launch Notes 8 with the OSGi console create a new shortcut and use the following command (change the path if Notes isn’t installed in c:notes8):

"c:notes8frameworkrcprcplauncher.exe" -config notes -console

Besides the -console switch the the rcplauncher.exe executable takes a number of interesting arguments. One of the really cool ones is that you can supply a port number after the -console switch to make the console listen on a telnet port. This way you can connect to a remote client using telnet.

"c:notes8frameworkrcprcplauncher.exe" -config notes -console 23

Cool, cool, cool.

If you’re developing Eclipse components I really suggest you look into the OSGi console as it can assist in troubleshooting bundles that fail to load due to unsatisfied requirements.

Were to start? Well when you have the console available try out these commands:

  • help: Pretty self-explanatory
  • ss: Shows all the bundles installed with their status (be aware – there’s a lot of them)
  • setlogrlev: Sets the log level of individual loggers. I’ll have an upcoming blog post on logging.
  • pbsh: Work with the property broker e.g. see defined wires etc.

I felt busy last week…

…even though my calendar doesn’t quite reflect that!

Just a little glitch in the CSI view framework of the Notes 8 client. Nothing major but funny too see how the appointments are drawn correctly but the text didn’t quite make it to the UI.

developerWorks: Plug-in development 101

Are you ready to get going on development of plug-ins for the Notes 8 client (Eclipse)? If you are then look no further than this series of articles on developerWorks: Plug-in development 101. It’s a bit sad that it isn’t Notes 8 specific but hey it’s in the Open Source zone but even though you get the basics of the necessary steps for creating plug-ins.

TwitNotes – update on 1.0.3 progress

Who said a long off-line commute isn’t productive. I have been adding support for clickable links in the UI so that web-links and links to other Twitteres will be recognized in the UI. Links to other Twitteres will also be recognized within the body of the tweet as well. Presently the click-action for web links is to open the link in the default browser and the action for clicking a Twittere, is to filter the UI to posts by that user (I have added an action in the part menu to reset any filter that has been added). Please provide input on this behavior if you have opinions about this.

I need to finalize the API for this before releasing but a 1.0.3 release should be right around the corner.

Week in review

Man it has been a busy week. I had Monday off due to Easter (national holiday in Denmark) but since then it’s been busy, busy, busy…

Besides being at a customer site all week incl. Saturday I hadn’t really expected the level of interest there would be in the TwitNotes plugin for Notes 8. Of cause I expected some to install it and try it out but not to the degree I have seen and heard about. I certainly got to test the comment system on lekkimworld.com – boy I have received a lot of comments. I would like to say thank you to all those who commented and all those who have contacted me by e-mail. The level of interest has been astounding and flattering.

Looking back it has also been an interesting journey from a development perspective as it has certainly brought some of the strengths and weaknesses of the “new” Notes platform into the light. I don’t think there’s much doubt that the platform is powerful and there’s potential but I was surprised to discover the level of difference in SWT performance and functionality across the different platforms (Windows XP, Windows Vista, Linux and Mac). It certainly takes some more consideration than plain ol’ Notes development.

Today I’m spending some time helping out my girl friends dad install and configure a new computer. Other than that I hope to get some time to work on TwitNotes. Yesterday I did some for on the UI to detect and handle links in posts to make them clickable. It sounds and seems simple but now that the table data is custom drawn to handle text wrapping nothing is simple. I have the fundamentals done already though.