Create Session in Java

Hi there,

I have the following code in Eclipse (using the local Notes.jar):

try {

		NotesThread.sinitThread(); //Init the tread

		Session s = NotesFactory.createSession(null, usr, pwd);

		// If we got here it worked

		success = true;

	} catch (Exception e) {

		LOGGER.error(e);

	} finally {

		NotesThread.stermThread(); //Terminate the tread

		

	}

The Eclipse IDE marks the line

Session s = NotesFactory.createSession(null, usr, pwd);

with an error claiming:

The method createSession(String, String, String) is ambiguous for the type NotesFactory

and won’t compile.

What can I do?

Subject: The first null is the culprit

Eclipse interprets the first null value as anything. There are 2 createSession() methods in NotesFactory that have 3 parameters with parameter 2 and 3 as String:

NotesFactory.createSession(Applet,String,String)

NotesFactory.createSession(String,String,String)

So the solution is:

String connectString = null;

Session s = NotesFactory.createSession(connectString, usr, pwd);