New THE VIEW article is out!

I’m happy to say that my newest article is online at THE VIEW website. The article is on managing and provisioning lotus.domino.Session objects to plug-ins in Sametime Connect 7.5.1 – a subject that’s a little tricky due to the native code underneath the Notes/Domino Java API and due to the way that classloaders work in Sametime Connect/Expeditor.

For the ones who’s already on Sametime 7.5.1 please see the errata (http://lekkimworld.com/theview_sametime).

Article abstract:

Take the mystery out of providing multiple Notes sessions from Sametime Connect. Plug-in developers find that running multiple Sametime plug-ins that access Notes at the same time is tricky; the reasons are due to how the Sametime 7.5 Java application-programming interface (API) differs from the one Notes uses, and how Java class-loaders load native library code on Windows. The solution provided in this article uses a bundled group of plug-ins, invisible to connect users, for managing lotus.domino.Session objects across other plug-ins. You also learn how to achieve fast plug-in deployments with automatic Connect configuration, plus easier plug-in maintenance. The solution code is available for download at THE VIEW Web site.

Citrix and AJAX – one bad combo?

Anyone using AJAX type-ahead controls under Citrix? I have been working on a customer solution using the select-widget from the dojo toolkit but it doesn’t work correctly in Internet Explorer under Citrix (you can type ahead but cannot use the arrow keys to select from the choices). Just checked script.acolou.us and their autocomplete widget doesn’t work either under Citrix either (same issue). Previously I have been using a solution I developed myself but really want to go mainstream…

script.aculo.us autocompleter example.

Show ‘n Tell Thursday: Showing a progress bar / joining threads (24 May 2007)


A fellow developer in the developerWorks forum had an issue where he wanted to load a lot of data and needed a progress bar to indicate progress. His problem was that the main thread terminated before his data loading was done and he needed help.

The solution is to use a data loading thread and Thread.join () the thread to wait for it to complete to avoid the main thread from terminating the agent. If you do not join the thread the main thread will terminate and abort the loading. The joining is bolded in the below code.

To test it out try running the below code with and without the l.join() line below commented out and see how the progress bar never reaches the end when the thread isn’t joined.

Also note that I’m extending NotesThread to avoid dealing with threads etc. in Notes and that the code is no where near production quality!

import lotus.domino.*;
import javax.swing.JDialog;
import javax.swing.JProgressBar;

public class JavaAgent extends AgentBase {
   private static int COUNT = 30;

   public void NotesMain() {

      try {
         // initialize
         Session session = this.getSession();
         AgentContext ac = session.getAgentContext();

         // start thread to similate loading
         Loader l = new Loader();
         l.start();
         for (int i=0; i<COUNT; i++) {
            System.out.println("i=" + i + " (" + session.getUserName() + ")");
            Thread.sleep(100);
         }

         // wait for progress thread
         l.join();

      } catch(Exception e) {
         e.printStackTrace();
      }
   }

   public static class ProgressBar {
      private JDialog dialog = null;
      private JProgressBar bar = null;

      public ProgressBar() {
         dialog = new JDialog();
         bar = new JProgressBar(0, COUNT);
         dialog.getContentPane().add(bar);
         dialog.setSize(250, 40);
      }
      public void visible(boolean flag) {
         dialog.setVisible(flag);
      }
      public void update(int i) {
         this.bar.setValue(i);
         this.bar.updateUI();
      }
      public void dispose() {
         if (this.dialog.isVisible()) {
            this.visible(false);
         }
         this.dialog.dispose();
      }
   }

   public static class Loader extends NotesThread {
      private Session session = null;
      private Database db = null;
      private View view = null;

      public Loader() throws NotesException {
         session = NotesFactory.createSession();
         db = session.getDatabase(null, "names.nsf");
         view = db.getView("People");
      }

      public void runNotes() {
         try {
            ProgressBar b = new ProgressBar();
            b.visible(true);

            for (int i=1; i<=COUNT; i++) {
               Document doc = this.view.getNthDocument(i);
               if (null != doc) {
                  System.out.println("Loaded person: " +
                     doc.getItemValueString("Firstname") +
                     " " + doc.getItemValueString("Lastname"));
               }
               b.update(i);
               Thread.sleep(500);
            }
            b.dispose();

         } catch (Exception e) {
            e.printStackTrace();
         }
      }

   }
}

Subclipse (SVN) properties

In my quest to find a way to automatically wrap commit messsages in the Subclipse SVN plug-in for Eclipse I found a description of some of the properties that are used to control the commit message dialog. Unfortunately it looks like there is no way to wrap the lines in the commit message dialog although no linebreaks are inserted. Bummer!

Java in Notes/Domino Explained: Stacktraces


Not much information on Java in Notes/Domino per say in this post but simply a pointer to a nice article on reading stack and tread dumps which is a must for all programming in Java.

Remember that as of Java 1.4 (Notes/Domino 7.x) you can use Java classes access the elements of a stacktrace. You can use this to further diagnose the trace and make a more intelligent decision on how to handle it. Look for the StackTraceElement class in the javadocs.

Link to article: Of Thread dumps and stack traces ….

Sametime 7.5.1 tabbed interface is loosing messages!

Well let’s say I was shocked when I found this out… After upgrading to Sametime 7.5.1 on the client as well on the server we have been been using the tabbed interface to handle the chats. While I like the interface a lot, my coworkers and I have stopped using it since we are experiencing that some chat messages simply dosn’t show up the Sametime Connect client and are “lost”.

We became aware of the problem when one of my coworkers told me that his Connect client was “dinging” but no new chat message appeared. I discounted the idea but as he kept telling me about this and I started experiencing it myself I started to get curious. Yesterday we decided to do a systematic test and have been able to consistently reproduced the issue. The issue is only visible when using the tabbed chat interface.

It doesn’t seem to be a problem with the server or client per say but the interface as the messages are showing the chat history.

Symptoms

The chat window flashes and “dings” but no new message is showing in the chat window. If you close the chat window and reopen it the full chat exchange, incl. all messages, are showing up – also the “lost” ones.

The issue occurs both for text messages, emoticons (which is simply text) and for graphics

System configuration

  • Server: Sametime 7.5.1, US English, on IBM Lotus Domino 7.0.2 on Windows 2003 Server
  • Client(s): Sametime 7.5.1 Connect client on Windows XP Prof. SP2 using the tabbed chat interface

Steps to reproduce

  1. User 1 and user 2 configures their Connect client to use the tabbed chat interface
  2. User 1 sends user 2 series of messages using an ascending messaging scheme (e.g. a, b, c)
  3. User 2 sends user 1 series of messages using an ascending messaging scheme (e.g. 1, 2, 3)

At some point you’ll discover that some messages are missing when looking at the ascending numbers or letters. Below is a couple of screenshots from a chat exchange from the office. The first screenshot is from my computer and I’m simply sending letters to my chat partner who is responding with numbers.

The second screenshot shows my chat partners Connect client after I have sent my third message (“c”). As you can see the second message (“b”) has been lost and isn’t showing. Also the name isn’t showing in front of my third message (“c”).

The third and final screenshot is of my chat partners chat history dialog. As you see all 6 messages (“1”, “2”, “3”, “a”, “b” and “c”) is showing here and is correctly prefixed.

As previously stated we have been able to consistently reproduce the issue on multiple occasions. I would be very much interested to hear if anyone else has been experiencing similar issues with the tabbed interface.

Service pack installation

Just found this nice tip from a friend of mine on installing service packs in VMWare images. When installing for example service pack 2 in a Windows XP image you can use the “/n” parameter to avoid saving backup files which might not be worth the diskspace in an image. Also using “/u” will make the installation program simply install the service pack and reboot the machine and not prompt you for approval.