Java in Notes/Domino Explained: Domino Session Tester


Testing local and remote sessions to Notes/Domino can be a hassle so I’ve created a small utility to help test the different kinds of sessions. To use the Domino Session Tester download the two listed jar-files at the end of the post to a directory, copy the notes.jar to the same directory and follow the below instructions for use.

Please note: If you get a message saying “Exception in thread “main” java.lang.NoClassDefFoundError: lotus/domino/NotesException” you haven’t copied Notes.jar to the directory…

Base syntax

The base syntax of the utility is as follows:

C:>java -jar domino_session_tester.jar

Domino Session Tester by Mikkel Heisterberg (http://lekkimworld.com)
Version: 1.0, Date: 10 July 2006

***********************************************************************************
* This utility is provided "AS IS" with no warranties, and confers no rights.     *
* Some rights reserved (disclaimer: https://lekkimworld.com/pages/disclaimer.html) *
*                                                                                 *
* This utility uses code from the Apache Jakarta Commons CLI project              *
* (http://jakarta.apache.org/commons/cli) and respects their copyrights.          *
***********************************************************************************

usage: Domino Session Tester
 -t,--type    session type (remote/local)

The above command will show the different options available to you. The only required argument is the -t argument where you specify the type of session to create (“local”/”remote”). Once you select “local” or “remote” more options will be available. Apart from this the utility should be pretty straight forward to use. I have shown some examples below.

Testing local session (using id-file from local Notes installation)

C:>java -jar domino_session_tester.jar -t local

Testing anonymous remote sessions

C:>java -jar domino_session_tester.jar -t remote -h diiop.example.com

Testing authenticated remote sessions

C:>java -jar domino_session_tester.jar -t remote -h diiop.example.com -u "John Doe" -p secret

Comments are as always welcome.

Downloadable files:

10 thoughts on “Java in Notes/Domino Explained: Domino Session Tester”

  1. Hhm,
    have you tested to create a local session on a Domino server? There you should be able to create both sessions with the LTPA or username/password but not use DIIOP.
    🙂

    Like

  2. If you mean pass null as the hostname then nope. I have always passed localhost as the hostname on a Domino server. I never thought of passing null for the hostname and then a LTPA token… Guess I should try that.

    Like

  3. You can try:
    String connectString = null;
    Session s;

    s = Notesfactory.createSession(connectString, ltpaString);

    s = Notesfactory.createSession(connectString, usrString, pwdString);

    You can’t use null directly in the statement but must have a String with a null value. This gives you a local session (non-corba) with server authentication. Must run on a Domino server.

    🙂 stw

    Like

  4. hi,
    after executing underline command I get error as below:
    #–command
    java -jar domino_session_tester.jar -t remote -h serverName -u “UserName” -p password
    #–error in command prompt
    [ERROR] – Unable to create authenticated remote session.
    NotesException: Could not get IOR from Domino Server: java.io.FileNotFoundExcept
    ion: http://oberon.tech.tcgivega.com/Notes/diiop_ior.txt
    at lotus.domino.NotesFactory.readIOR(Unknown Source)
    at lotus.domino.NotesFactory.getIOR(Unknown Source)
    at lotus.domino.NotesFactory.createSession(Unknown Source)
    at lotus.domino.NotesFactory.createSession(Unknown Source)
    at com.lekkimworld.sessions.Main$RemoteSessionFactory.getSession(Main.ja
    va:309)
    at com.lekkimworld.sessions.Main.main(Main.java:159)
    Exception in thread “main” java.lang.NullPointerException
    at com.lekkimworld.sessions.Main$RemoteSessionFactory.postSession(Main.j
    ava:339)
    at com.lekkimworld.sessions.Main.main(Main.java:197)

    #—error found in server at http://oberon.tech.tcgivega.com/Notes/diiop_ior.txt

    Http Status Code: 404

    Reason: File not found or unable to read file

    plz help me.

    Like

  5. Hi there! I must say your ‘article’ was very useful to me, now I know that it is possible to use the LTPA token to create a session in when using a ‘servlet’ from a portlet to connect to a domino database!
    I am using Domingo to get the domino java api, but I am not sure HOW to get the LTPA token-string. Can anyone advise me??
    Thanks in advance..

    Like

  6. From the HttpServletRequest get the cookies and loop through them until you find a cookie called LtpaToken (or whatever name you use for it), extract the data and use that for your session.

    Like

  7. I am new to the topic discussed here. I need some great help write a stand alone java application that should read a nsf file that resides on a computer but the java program shoud be run from another computer. Thanks in advance for your help!

    Like

Comments are closed.