Bleeding Edge 12/13/06 – No More java.library.path

A very nice addition in relation to loading native libraries from plugins has been added to the next Eclipse release (version 3.3) in the M4 milestone build. While it looks like the addition is only applicable to the SWT native libraries I really hope that the addition will also be applicable to custom plugins at some point in the near future as it would make devlopment of plugins with native access much easier.

Why is this of interest to you? Why because Sametime is built upon Lotus Expeditor (actually a pre-release of Lotus Expeditor) which in turn is built upon Eclipse 3.2…

I don’t think there is much hope of relief any time soon however… ๐Ÿ™ Judging from how long it has taken IBM to move from previous Eclipse releases for their other products such as Rational Application Developer I don’t think that Expeditor will be any different and I think we will be “stuck” on Eclipse 3.2 for Sametime development for a long time.

There are solutions however – stay tuned for my upcoming article in THE VIEW to read more… ๐Ÿ™‚

Full article: Bleeding Edge 12/13/06 – No More java.library.path

The Sametime 7.5 Server Installer vs. Sophos Antivirus

When trying to install Sametime 7.5 Server on a computer running Sophos Antivirus be sure to disable the antivirus service while installing. If you don’t you’ll most likely get an error saying “Installation has detected some Domino or Sametime processes already running” and you will be unable to continue. The answer was found in technote 1245237.

Technote 1245237:
Error installing Sametime 7.5 server: ‘Installation has detected some Domino or Sametime processes’…

Show ‘n Tell Thursday: The missing link for plugging Notes into you Sametime 7.5 plugin (10 January 2007)


When you develop and run plugins for Sametime 7.5 on Windows or Linux you do not use a standard Java Development Kit (JDK) and standard 1.4.2 JVM. Instead you use a slightly modified version called the JCL Desktop JDK and the J9 JVM. The “slightly modified” means that some features have been removed from the JDK to make it “safe” for the Expeditor framework that Sametime 7.5 runs on.

An unfortunate side-effect of this decision is that you cannot use the Notes/Domino API (that is notes.jar or ncso.jar) without resorting to additional libraries. The reason is that the ever present lotus.domino.NotesException inherits from org.omg.CORBA.UserException which is an exception class that has been removed in the modified runtime class library (for more information about lotus.domino.NotesException see my post called Java in Notes/Domino Explained: NotesException).

Fortunately there is a way to remedy that. The solution is to include the ibmorbapi.jar library (can be found in c:Program FilesNotes7Datadominojava on my laptop) in your plugin alongside notes.jar or ncso.jar. The ibmorbapi.jar library is quite large (around 400kb) but I haven’t yet played around with it to see if you could simply get away with including the org.omg-packages.

Now you know why your plugin fails to compile due to indirectly referenced Corba classes.

Anyways – someone who has the ears of the Sametime development team might want to mention this to them. Apart from that – great product and its a joy to develop plugins for Sametime 7.5! ๐Ÿ™‚

Update Site for Sametime – why not simply go local?

As pointed to by Adam Gartenberg there’s a new article out on developerWorks (Creating an update site for your IBM Lotus Sametime Connect plug-ins) on how to create an Update Site for your Sametime client deployment. As much as I would recommend the article I really would suggest that readers don’t stop there and read the entire story on Update Sites at Eclipse.org (How to keep up to date) before venturing into this territory.

Although the developerWorks article does a nice job of describing the subject for the Sametime inclined I would recommend also reading about the Eclipse foundations…

As an aside I also wants to mention that you can test plugins using an Update Site without having a HTTP server ready (although we all have a Domino server ready, no?). You can do this because the Eclipse framework also allows for local Update Sites (i.e. on the same computer or on a network share). To use this feature simply choose “Local Site” instead of “Remote Site” and point your Sametime client to the Update Site directory under your Eclipse workspace. Very nice for testing.

Doclinks in Sametime 7.5

You might know that a doclink is actually nothing more than some text in a special format. The below snippet is a doclink to an e-mail in my mail database. As you can see it contains the replica id of the database and the UNID of the view and the document to go to.

Mikkel Heisterberg - Vedr.: Re: mail sync.
<NDL>
<REPLICA C1256833:0079BF90>
<VIEW OF38D46BF5:E8F08834-ON852564B5:00129B2C>
<NOTE OF1B86D647:A8161190-ONC125723D:005E6086>
<HINT>CN=server1/O=Example</HINT>
<REM>Database 'Mikkel Heisterberg', View 'Inbox', Document 'Vedr.: Re: mail sync.'</REM>
</NDL>

The same is the case for a view link except that there’s no document UNID present.

Mikkel Heisterberg - Inbox
<NDL>
<REPLICA C1256833:0079BF90>
<VIEW OF38D46BF5:E8F08834-ON852564B5:00129B2C>
<HINT>CN=server1/O=Example</HINT>
<REM>Mikkel Heisterberg</REM>
</NDL>

A database link is even more slimmed down and it only contains the replica id of the target. For some reason the chat area fail to convert this into a notes:// URL – could be that the regular expression IBM use to match a doclink doesn’t take database links into account.

Mikkel Heisterberg - Inbox
<NDL>
<REPLICA C1256833:0079BF90>
<HINT>CN=server1/O=Example</HINT>
<REM>Mikkel Heisterberg</REM>
</NDL>

Does anyone know whether this is a known issue or something I should report to Lotus Support or even worse write myself? Actually I don’t think it would take too long to write since it’s a slight modification of the acronym sample plugin supplied with the Sametime SDK. I would of cause prefer not to… ๐Ÿ˜‰

Writing log messages in Sametime 7.5 plugins

Unfortunately the Sametime 7.5 SDK doesn’t contain any information that I can find on how to use log and debug messages in custom plugins. Furthermore all the Sametime 7.5 articles on developerWorks I have seen use System.out which is really a no, no. This post contain some information on logging that I have found out myself – partly through looking around in the Sametime 7.5 Connect client installation and partly by trial-and-error.

FYI: I’m doing a fair bit of Sametime 7.5 plugin development at the moment. For one because it’s fun and second because I’m writing an article for THE VIEW (slated for the March/April issue) on Sametime 7.5 development.

Introduction

Logging is at the heart of any development project whether that be a Notes database or a Java application. You can of cause resort to using System.out / System.err for logging but that’s clearly a no, no! If you are in doubt why I suggest you start here. Once you come to the conclusion that you really should be using a logging framework there basically is two options:

  • java.util.logging (available directly in the JDK since JDK 1.4)
  • Apache log4j

Many libraries will furthermore use Jakarta Commons Logging to isolate themselves from the underlying logging technology. In part because they cannot tell which logging framework will be used by clients and because it affords the client the choice.

However in the case of the Sametime 7.5 Connect client the choice has been made for you since Sametime 7.5 uses java.util.logging. You can choose to use Commons Logging but then the logging levels will not fit the ones used in Sametime.

I would suggest you stay with java.util.logging.

Please note: The way logging works while developing plugins in Eclipse is very much different from how it works in the *real* client. When developing all logging, incl. System.out, goes to the console.

Using java.util.logging

Obtaining a java.util.logging.Logger instance is easy:

Logger log = Logger.getLogger(this.getClass().getName());

I suggest you follow the above example and use the class name as the logger name which is also a best practice and the way that IBM does it.

Once you have the Logger-instance you can use it to log information using the different logging Levels (see the Javadoc for more information on java.util.logging).

Configuring logging in Sametime 7.5

The logs written are placed in the Sametime-directory under your using profile hereafter called the log-directory. On my Windows laptop this is “C:Documents and Settingslekkim.HQApplication DataSametime”. The logging itself is configured from the sametime.properties file in the Sametime 7.5 Connect client directory (again on my Windows laptop this is “C:Program FilesIBMSametime 7.5”).

The top of my default sametime.properties looks like this:

## G11N DNT
## Logging properties
.level=INFO
logger.filename=sametime.log
logger.includeClassInfo=true
logger.toConsole=true
logger.level=ALL
logger.limit=20000000
logger.count=7
org.apache.axis.level=INFO
redirectSystemOutput=true

## app properties
...
...

By default log-messages goes to sametime.log.0 in the log-directory with the maximum level of INFO (top bold line). To diagnose issues increase the log level to FINE, FINER, ALL etc. Be aware that the finer levels will produce *lots* of output. Note that messages written to System.out is directed to System.err by default (the second line in bold). To get this information change the redirectSystemOutput to false.

Doing this will cause output to be written to sametime.log in the log-directory instead. Restarting the Sametime 7.5 client while redirectSystemOutput is false will rotate the previous sametime.log to sametime.log.previous.

The nitty-gritty details

It appears that most of the java.util.logging configuration is done through the rcpinstall.properties file in /plugins/com.ibm.rcp.base_6.1.0.0-20060714/config/muservice. Although I wouldn’t suggest changing the file itself it may be beneficially to peruse the file to see how it’s done.

If you really want to know that is… ๐Ÿ˜‰

Conclusion

It appears that Sametime uses java.util.logging and that is is quite straight forward to use – once you know how… Logging levels are easily controlled from sametime.properties and extending the logging framework to do central logging should be easily accomplished.

Happy logging…

Sametime 7.5 client language when doing plugin development


If you are doing any Sametime 7.5 plugin development you might have noticed that the client always starts up in your local language – Danish in my case. If your native language isn’t English and you’re developing international plugins you might want to run the Sametime client in English instead which you can do by adding a command line parameter in your launch configuration.

To do this open your launch configuration, go to the Arguments-tab and add “-nl <locale>” (without the quotes) in the “Program arguments” field. The specified locale can be any valid Java Locale such as US, DK or DE.

Re:Removing the slash screen from Sametime 7.5

As mentioned in my SnTT post on 5 October 2006 (post) you can remove the splash screen from Sametime 7.5 by hacking the config.ini file in the configuration-directory. A by far easier way is simply to add -noSplash as a command line argument to sametime.exe in your Windows shortcut or to the sametime executable on Linux.

A little easier… ๐Ÿ˜‰

Central repository of known locations for Sametime 7.5

If you have Sametime 7.5 installed and use the location awareness you’ll have a file called locprofile-config.xml holding the locations you have configured so far (mine is in C:Documents and Settingslekkim.HQApplication DataSametime.metadata.pluginscom.ibm.collaboration.realtime.location).

The locations are identified by the network you are connected to and is identified by the current IP-subnet and the MAC address of the default gateway.

<?xml version="1.0" encoding="UTF-8"?>
<locprofconfig>
   <locprofiles>
      <locprofile profilename="192.168.1.0 00:09:7C:2B:74:88       ">
         <locations>
            <locip>192.168.1.0</locip>
            <macaddr>00:09:7C:2B:74:88</macaddr>
         </locations>
         <personalloc>it-inspiration hq</personalloc>
         <city>kรธbenhavn k</city>
         <country>DK</country>
         <postalcode>1058</postalcode>
         <primphone>70223141</primphone>
         <shareloc>true</shareloc>
         <timezone>Central European Time (GMT +1)</timezone>
      </locprofile>
      <locprofile>
         ...
      </locprofile>
      <locprofile>
         ...
      </locprofile>
   </locprofiles>
</locprofconfig>

At present the file is person dependent but since it is part of a plugin but I think it would be really cool if parts of the file could be populated from a central repository via an extension point. This way the Sametime Connect client would automatically display the correct location of the user throughout the company without each user having to update the file themselves. It would also mean that the information could be entered and displayed in a consistent manner.

Of cause the user would still have to specify the location details for custom locations such as hotels, home work stations etc. but I think it would make life easier for the majority of users.

Just an idea…