GoogleIt Mail IT Print IT PermaLinkDomino And Java On iSeries, or The Case Of The Missing JAR
11:57:16 PM

Not too long after I took my current position, I started lobbying to expand the official matrix of supported Domino versions and platforms that our product runs on. "Domino is Domino and the bulk of our code is Java" I said, but I always qualified it with "but nothing's guaranteed, and in fact the one thing I really would worry about is the JVM versions across different Domino versions and platforms."

I ran into a problem with varitions between Domino platforms for the first time last week, and indeed it is Java-related Actually, it's not really a JVM version problem per se as far as I can see. It's a problem of what is, or is not packaged with the JVM included in various Domino releases. Specifically at issue is the file jvm\lib\ext\mail.jar (or mailapi.jar... I've seen both, and I don't think it really matters what the file name is). This file is included with Domino releases on Windows, but it seems to be missing in Domino releases on Linux and on iSeries. I don't know about the other platforms. Haven't checked, yet.

The mailapi.jar file is a set of standard Sun Java classes in the javax.mail.* package. It contains a lot of useful classes for people who are dealing with SMTP messages, MIME, and SMTP addresses, and you might imagine that I could find some uses for it in an agent. From what I can gather, it is not a mandatory part of a Java implementation, so it's ok that it's omitted in some cases. But why, if it is there on Domino for Windows, is it not there on at least some of the other platforms?

I discovered that the file was not there on Linux when the latest version of an agent in our product, which I had been running successfully on several Windows servers, threw a "NoClassDefFound" error when I tried to run it on a Linux server. Solving this proved to be quite easy: just copy the jar file from the Windows server to the /lib/ext directory on the Linux server, and all was good. But then I got suspicious about what other platforms might not have this file. I sent a test agent to someone with access to an iSeries machine, and it threw the error. I contacted Kim Greene (whom many of you will know is a top-notch Domino on iSeries consultant) and she graciously agreed to check into it, and she not only confirmed that the file is not there, but also that simply copying the jar from Windows and dropping it in the equivalent directory on the iSeries filesystem (I couldn't tell you what the equivalent directory is, so don't ask!) did not make my test agent work. If even Kim, with the knowledge and contacts that she has, ends up stumped about why the problem exists and how to fix it on iSeries, then surely this is a Hard Problem!

Fortunately, I had a Plan B in my pocket. It was Plan B because, for various reasons, it would be a lot better if I could just take the code that had already passed QA on Windows and say that it works on iSeries if you just copy a file and put it in place X. That was Plan A, but it was not going to happen. Plan B was simple: just import mailapi.jar into a new Java Library in Domino Designer, add that Library to the Java project definition for the agent that uses the classes, remove the import directive for java.mail.*, and make all the references to the classes in the agent code use the explict path, and comple. And for good measure, remove the file from the local jvm\ext\lib directory so that you're absolutely sure that the classes are being resolved at compile time through the Java Library.

This page has been accessed 498 times. .
Comments :v

1. kerr11/14/2006 05:40:51 AM

Why do you need to replace the import statements with full class references? I've bundled third party jars in agents and in separate script libraries plenty of times and never had to do this. Have I missed something?

I'm also deeply curious as to my adding the jar to the lib/ext dir of the jvm on iSeries didn't work. Either it's a bug, an odd security setting or there are some crazy iSeries deployment hoops you need to jump through, because from a java perspective this should Just Work(TM).

2. Richard Schwartz11/14/2006 07:10:27 AM

I just kind of assumed that the import would want to go to the filesystem and pull in the class -- but now that I think about it, import is really just a syntactic thing, not a directive to actually load the class, so that was probably a wrong assumption.

3. Ken Yee11/14/2006 04:33:30 PM

Did Kim bounce the iSeries server or at least the Domino server before checking the agent? That extensions directory is only read on initialization of the JVM, i.e., on Domino startup. The JVM on iSeries is more integrated into the OS (or used to be) so you might need to bounce the server to get it to see it.
Yep, had lots of those fun issues w/ pop3fido when I made it a Java server add-in...

4. Richard Schwartz11/14/2006 04:48:25 PM

I don't know if she bounced it or not.

5. vesoftware11/05/2013 10:17:03 PM

Agen Bola Promo 100% SBOBET IBCBET Casino Poker Tangkas Online
ITUPOKER.COM AGEN POKER ONLINE INDONESIA TERPERCAYA : Toko belanja online murah, Promo heboh jual barang hanya Rp 1,-

6. viagra09/20/2016 08:11:12 AM
Homepage: ,

7. chenyingying10/17/2016 12:10:24 AM

8. chenjinyan11/22/2016 02:58:57 AM
Homepage: http://

Enter Comments^

Email addresses provided are not made available on this site.

You can use UUB Code in your posts.

[b]bold[/b]  [i]italic[/i]  [u]underline[/u]  [s]strikethrough[/s]

URL's will be automatically converted to Links

:-x :cry: :laugh: :-( :cool: :huh: :-) :angry: :-D ;-) :-p :grin: :rolleyes: :-\ :emb: :lips: :-o
bold italic underline Strikethrough

Remember me    

Monthly Archive
Responses Elsewhere

About The Schwartz


All opinions expressed here are my own, and do not represent positions of my employer.