I am finally getting to work on some Java with Domino, but I’m still very new to this and have run into a wall. I’m hoping someone may offer some insight/advice.
I need to connect from my Notes database to a web service to request a special ID. The target web service requires an SSL connection and authentication using an application certificate – a java keystore (.jks) file that is stored in the Domino\Data directory on the server – and returns an bit of xml in response.
After some setup code the agent attempts to set some system properties with the information needed to make the connection to the external web service:
System.setProperty(“javax.net.ssl.keyStore”, m_keystorepath);
… where m_keystorepath is a variable pointing to the .jks file in the domino/data directory (ex: D:\Lotus\Data\filename.jks)
When the code gets to this line the agent fails and simply prints to the log file:
Agent printing: Error: java.lang.NullPointerException
I know the agent fails on this line of code because I have a println statement before it which works, and after it which is never reached.
For other errors I got a stack trace which gave more details and traced the error back to a particular line of code. For this I get only the line above. Since the error is the nullpointerexception and not errors related to authorization or authentication, I’m not sure what the problem may be.
I know the variables are set because that’s what I print out immediately before the call to set the system property.
I added the java 1.4.2 jsse.jar file to the C:\Lotus\Domino\jvm\lib\ext directory on the server to ensure the javax.net.ssl classes are in the classpath
I added the import statements to the agent to use the classes:
import javax.net.*;
import javax.net.ssl.*;
I used the ‘edit project’ button for the domino java agent to import the jsse.jar file for the agent.
There’s probably something I’ve overlooked – and I may have done things I didn’t need to do – so if anyone with experience can offer suggestions or a solution, any assistance will be greatly appreciated.
Thanks