If you are experiencing problems connecting to a Lotus Domino server remotely from a WebSphere Java application, check the following to see if your application environment is set up properly:
- Make sure Domino Internet Inter-ORB Protocol DIIOP is set up on the Lotus Domino server. If DIIOP is not set up, you will receive a message that the remote host refused the connection.
- Make sure to specify the port number of the Lotus Domino HTTP server when trying to obtain a NotesFactory session. For example:
Session session = NotesFactory.createSession("systemName.domainName:portNumber", "user ID", "password").
This will allow the CORBA request to get to the correct server. If the port number is not specified, you will receive a NotesException. - You may receive a NotesException of 4377, which states the following: "Server must be on same host as session when performing the getDatabase statement from a Java application using the following lines of code:
Session session = NotesFactory.createSession(notesServer, notesUser, password);
ndbContent = session.getDatabase(notesServer, notesDatabase);"
There are two solutions: 1) On the getDatabase, send only the server name, not the server name along with the port number. 2) Pass in a pair of quotation marks ("") as the notesServer on the getDatabase call, which will force the use of the session just created:
ndbContent = session.getDatabase("", notesDatabase);
- Make sure that the CLASSPATH contains the NCSOW.jar file obtained from the version of Lotus Domino that you are using. This is the WebSphere version of the NCSO.jar file. The NCSO.jar is unusable because the IIOP levels will clash and you will not be able to create a session.
- To use the Domino Java APIs to connect from a WebSphere Java application to a Domino database via IIOP, the application must import the lotus.domino.* package.
- To obtain additional information on NotesExceptions, add the System.out.println in the code below. This allows you to print out static variables that explain the error better.
catch(lotus.domino.NotesException ne)
{
System.out.println(ne.text + " " + ne.id);
ne.printStackTrace();
}
Dan Boyum is a Software Engineer on the Business Solution Test team located at the Rochester, Minnesota, laboratory. He has 2.5 years of experience in the software testing field. His areas of expertise include Lotus Domino and Windows servers on iSeries. Dan can be reached at
Marilyn Dukart is an Advisory Software Engineer on the Business Solution Test team located at the Rochester, Minnesota, laboratory. She has over 15 years of experience in the software testing field. Her areas of expertise include Lotus Domino and WebSphere. Marilyn can be reached at
LATEST COMMENTS
MC Press Online