Javax.comm frustations. Almost, but not there

I am able to open a COM / serial port with javax.comm api. It works in my Visual Age/Java environment, but when I try to port it to a Notes agent, it becomes a problem.

I looked at the Lotus Forums and this seems to be problematic, currently though, I believe I am closer to get this to work. Alas, I finally concede that I hit a brick wall, and I think I will simply rewrite my application with Win32 API calls instead.

If helpfull to anyone else, the following are some key setup that I found helpfull.

Again, I tested my code with Visual Age to ensure it to work (In visual age, copy the javax.comm.properties file to the X:\VA\ide\program\lib; copy win32com.dll to X:\VA\eab\bin; of course, put the comm.jar file within your project or in your jvm’s classpath / lib’s)

Anyway, I was testing the lotus java environment, and the best place I found to place these files were x:\notes (win32com.dll), x:\notes\jvm\lib (javax.comm.properties), and the comm.jar file is embedded into my agent. My agent was given the access level of “3. Allow restricted operations with full administration rights” in the Agent Properties

I’ve gotten a lot of error messages about linking problems before I placed the files in those location, now I get the following:

“Caught java.lang.NullPointerException: name can’t be null while loading driver com.sun.comm.Win32Driver”

This error is triggered by the very first line (again, this executes fine in my Visual Age)

“Enumeration portList = CommPortIdentifier.getPortIdentifiers();”

I think the fact that Notes/Agent is looking for win32com.dll in the x:\notes directory is a problem–in other Java JVM/JRE it should be in a bin directory. (I tried putting it in the bin directory, and I got a linking error. I have also tried to use the JavaUserClasses line in the Notes ini to point to those directories and more, but no luck.)

In the meantime, I’ll resort to use Win32 API’s to perform COM / serial calls.

Well, I hope this helps the next person trying the javax.comm api’s. If someone succeeds, I hope this is helpfull–and if you don’t mind, drop me an e-mail (for my own edification, and thanks in advance)

-Kyle

khuang100@hotmail.com