Turning 30!

Oh no! The big three-zero is nearing – I’m turning 30 the day after tomorrow (Sunday). I guess I have to find a more mature-looking picture for the picture on the right… ๐Ÿ™‚

Funky Notes/Domino JVM error (java.lang.IllegalAccessError)

An interesting issue with the Domino JVM was brougt to my attention today via a comment from an anonymous (Paul M. Westwood?) poster today. As you can see from my reply to the comment I was able to reproduce the issue and I recommend that the commenter report the issue to Lotus Support.

The issue is of interest to me due to the work I have been doing on developing a new AgentBase class for use from Eclipse

edbrill.com down?

It’s funny. When you access so much information through RSS you sometimes forget or fail to realize that sites may be down – even very public sites like edbrill.com. I guess I’ll have to wait… ๐Ÿ™

(This is in no way like me pointing any fingers. I’ll be the first to admit that there are times when lekkimworld.com isn’t available – bad things happen.)

EclipseZone: IBM Sametime Instant Messaging To Be Eclipse Based

The word is spreading:

“Although to some us (thanks to little drop-ins by Chris Aniszczyk) this may come as no surprise, it has become official that the Sametime instant-messaging client is now built throug the Eclipse Rich Client platform components.”

The post also mentions the new Sametime 7.5 Microsoft Office features mentioned by Ed Brill yesterday:

“Sametime 7.5, which will be available in about two months, will allow people to use instant-messaging features without having to leave Office applications. For example, a person could open up an e-mail inside Outlook and find out whether the sender is available on Sametime and where he or she is located.”

Full post @ EclipseZone: IBM Sametime Instant Messaging To Be Eclipse Based

Java in Notes/Domino Explained: Test agents in Eclipse by extending AgentBase (part 5)


By now (I assume you read part 1, part 2, part 3 and part 4) we have a working AgentBase extension called EclipseAgentBase. In this part I’ll show how to use the new and improved AgentBase class to easily write, test and debug Notes/Domino Java agents in Eclipse.

Please bear in mind that setting up the runtime environment for each agent below can seem like a chore and unnecessarily complex and cumbersome. It does however have the advantage that you can test the agent code and not worry about whether the database is a known state etc. It is my experience that most times when agents fail in test it is because some required document or profile document is missing. You can stub out these requirements with the new EclipseAgentBase class so you can focus on the agent code.

Enough explaining – let’s look at some code.

Simple agents, no objects from AgentContext

In the most simple agents, which is normally never the case,me where you do not use any objects from the AgentContext you only need to override the NotesMain method and implement the main()-method boilerplate code. As you can see from the example you can use the isNotes() method if you need to know whether the code is running in Notes/Domino or in Eclipse. Notice how the code runs perfectly no matter if you run the code in Notes/Domino or in Eclipse.

import lotus.domino.NotesThread;
import lotus.domino.Session;

public class ExampleAgent1 extends EclipseAgentBase {

   public static void main(String[] args) {
      try {
         NotesThread.sinitThread();
         new ExampleAgent1().NotesMain();

      } catch (Exception e) {
         e.printStackTrace();
      } finally {
         NotesThread.stermThread();
      }
   }

   public void NotesMain() {
      try {
         Session session = this.getSession();
         if (this.isNotes()) {
            System.out.println("We're in Notes...");
         } else {
            System.out.println("We're outside Notes...");
         }
         System.out.println("Username: " + session.getUserName());
      } catch (Exception e) {
         e.printStackTrace();
      }
   }
}

“Normal” agents, using AgentContext.getCurrentDatabase()

In what I call “normal” agents you will probably at least use some information about the current database. To do this we have to override the callbackGetCurrentDatabase() method of the agent (in bold below). This overridden method will only be used when running outside Notes/Domino. If your agent does a lot of calls to the method you might want to store the database instance and return the same instance if called multiple times.

import lotus.domino.Database;
import lotus.domino.NotesException;
import lotus.domino.NotesThread;
import lotus.domino.Session;

public class ExampleAgent2 extends EclipseAgentBase {

   public static void main(String[] args) {
      try {
         NotesThread.sinitThread();
         new ExampleAgent2().NotesMain();

      } catch (Exception e) {
         e.printStackTrace();
      } finally {
         NotesThread.stermThread();
      }
   }

   protected Database callbackGetCurrentDatabase() throws NotesException {
      return this.getSession().getDatabase(null,"names.nsf");
   }

   public void NotesMain() {
      try {
         Session session = this.getSession();
         System.out.println("Database title: " +
               session.getAgentContext().getCurrentDatabase().getTitle());
      } catch (Exception e) {
         e.printStackTrace();
      }
   }
}

Document agents, using AgentContext.getUnprocessedDocuments()

Many agents is built to process the unprocessed documents of the database. This poses some problems when configuring the runtime environment for testing. This is purpose I have written a couple of utility classes to help set this up.

Stay tuned.

Free Access to Safari Books Online

I don’t know if you’re aware of O’Reilly Safari which is an online bookself. It’s a great resource – especially if you are a travelling consultant or simply need/wants online access to your books. I have been a subscriber for a while and can recommend the service. Now, in corporation with Sun Microsystems O’Reilly is offering a 30 day access, free of charge, to the system (normal trial period is 14 days). Apart from the book titles you’ll also be entitled to access to a couple of free web courses incl. “Introduction of Java Programming Language” which might be of interest to some.

“Sun now has a partnership with Safari Books Online and you can get free 30 day access to over 1700 IT online books, which includes the great Sun Press books as well as four Sun web courses.”

Free Access to Safari Books Online (via dZone):