Protecting your plugin imports in Notes 8

A very common problem I see in Eclipse, Lotus Expeditor, and Lotus Notes is the installation of multiple org.apache.XXXX packages (more than one plugin exporting the same package). Eclipse will attempt to resolve your import as best it can but in short it just guesses and there is no control which one it will pick unless you specify a package version – I believe the default is last installed wins – not really sure. This can be very difficult to debug – and usually stuff just “stops working”.

The problem is the Apache packages can vary greatly depending how the third party has structured their plugins. So a best practice is to not install new org.apache packages and use the ones that ship with Expeditor and Notes.

If you are referencing these packages you can protect your applications by specifying the version of the packages in your import statement. For instance, the core property broker plugin imports the org.apache.axis plugins like this:

org.apache.axis;version=”1.4.0″;platform=xpd,

Notice we state to use the version “1.4.0” and from the platform “xpd”? This will insure our plugin uses only the org.apache.axis plugin with that exact version in the xpd platform.

So your code can also depend on specific org.apache packages. Most of the org.apache.axis.XXXX packages have version “1.4.0”.

Here is a list of the versions for commonly used packages in the latest Notes 8.5:

org.apache.axis.utils;version=”1.4.0″;
org.apache.axis.message;version=”1.4.0″;
org.apache.commons.logging;version=”1.0.4″;
org.apache.commons.httpclient;version=”3.0.0″;
org.apache.commons.codec;version=”1.3.0″;

For any other versions you can always open the jar files for the plugins and inspect the manifest.mf. You can also get at this information from the OSGI console.

osgi> bundle org.apache.axis

Remember, this is not the plugin version but the package version exported by the plugin. For instance, here is some of the org.apache.axis plugins export statement:

Export-Package: com.ibm.wsdl;version=”1.4.0″;platform=xpd,com.ibm.wsdl.extensions;version=”1.4.0″;platform=xpd,com.ibm.wsdl.extensions.http ;version=”1.4.0″;platform=xpd,com.ibm.wsdl.extensions.mime;version=”1.4.0″;platform=xpd,com.ibm.wsdl.extensions.schema;version=”1.4.0″;platform=xpd,com.ibm.wsdl.extensions.soap;version=”1.4.0″;platform=xpd…..

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.