Java in Notes/Domino Explained: Different kinds of sessions
When creating sessions to Notes/Domino (lotus.domino.Session) you have to distinguish between the two different types:
- Local sessions
- Remote sessions
Local sessions
You create a local session using the methods of lotus.domino.NotesFactory class that doesn't take a hostname argument. The session is actually just a thin wrapper around native calls to an underlying DLL/shared library hence you need to have the binary Notes and/or Domino code installed on the machine your code runs on.
Local sessions cannot be created using a LTPA (Lightweight Third Party Autentication) token or anonymously.
To use local sessions you need to include the notes.jar file on the classpath of the code.
Remote sessions
Remote (or Corba) sessions are run over the IIOP wire protocol hence you need the DIIOP server task loaded on the Domino server. You do not need to have the HTTP server task loaded on the Domino server to use remote sessions. The reason you would normally load HTTP anyway is if you want the code to automatically discover the hostname and port to use for the Domino server. This is done via the IOR (Interoperable Object Reference) and the diiop_ior.txt on the Domino server (http://diiop.example.com/diiop_ior.txt). If you do not load the HTTP task you can provide the IOR to the NotesFactory method as a String.
You cannot create remote sessions against a Notes client installation.
Remote sessions are created using the methods of lotus.domino.NotesFactory that take a hostname as an argument. Remote sessions can be created anonymously, using cleartext username/password or using a previously established LTPA token.
To use remote sessions you need to include the ncso.jar file on the classpath of the code.
URGENT : OC4J - Domino R6 - DIIOP connection
URGENT : OC4J - Domino R6 - DIIOP connection
Re: Java in Notes/Domino Explained: Different kinds of sessions
I can connect seamlessly locally to my notes client.
However, I am trying to connect to my domino server 8.5 using the tool remotely.
I added NSCO.jar at the class path. I connect anonymously. I get the
following error. Could the problem be in some configuration in the server allowing access anonymously?
Thank you !
[ERROR] - Unable to create authenticated remote session.
NotesException: Could not open Notes session
at lotus.domino.cso.Session.initSession(Unknown Source)
at lotus.domino.cso.Session.<init>(Unknown Source)
at lotus.domino.cso.Session.createSession(Unknown Source)
at lotus.domino.NotesFactory.createSessionUP(Unknown Source)
at lotus.domino.NotesFactory.createSession(Unknown Source)
at com.lekkimworld.sessions.Main$RemoteSessionFactory.getSession(Main.java:309)
at com.lekkimworld.sessions.Main.main(Main.java:159)
Caused by: org.omg.CORBA.COMM_FAILURE: java.net.ConnectException: Connection refused: connect Host: 63.202.173.232 Port: 63148 vmcid: 0x0 minor code: 1 completed: No
at lotus.priv.CORBA.iiop.ConnectionTable.get(Unknown Source)
at lotus.priv.CORBA.iiop.ConnectionTable.get(Unknown Source)
at lotus.priv.CORBA.iiop.Generic.getConnection(Unknown Source)
at lotus.priv.CORBA.iiop.Generic.locate(Unknown Source)
at lotus.priv.CORBA.iiop.RepImpl.invokePreamble(Unknown Source)
at lotus.priv.CORBA.iiop.RepImpl.invoke(Unknown Source)
at lotus.priv.CORBA.portable.ObjectImpl._invoke(Unknown Source)
at lotus.domino.corba._IObjectServerStub.createSession(Unknown Source)
... 7 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at lotus.priv.CORBA.iiop.Connection.newSocket(Unknown Source)
... 15 more
Re: Java in Notes/Domino Explained: Different kinds of sessions
Re: Java in Notes/Domino Explained: Different kinds of sessions
Hi There,
I am using notesfactory to createsession with Domino from my Java application . After 30 connections, its saying "Unable to create notes session" . This exception occurs even though I have recycled all notes objects and garbage collected the objects in JVM also.
Please suggest me how we can solve this problem.
Re: Java in Notes/Domino Explained: Different kinds of sessions
remote sessions from my java application ,I havenot implemented any thread concept here, Domino version 7
Exception:
<p style="MARGIN: 0in 0in 0pt" class="MsoNormal"><strong style="mso-bidi-font-weight: normal"><span style="FONT-FAMILY: "Courier New"; COLOR: red; FONT-SIZE: 9pt">Construct JAXB objects...NotesException: Could not open Notes session<o:p></o:p></span>If connections reaches more than 30 iam getting this exception. Even though I have recycled the objects.
Pls see my code:
<font color="#0000c0" size="2"><font color="#0000c0" size="2">s
<font size="2"><font color="#0000c0" size="2"><font color="#0000c0" size="2">db
<font size="2"><font size="2"><font size="2"><font size="2">
viewEntry =
<font size="2"><font size="2">document = viewEntry.getDocument();
<font size="2">longDesc =document.getItemValueString(IMSWebProperties.getInstance().getNotesColumn());
<font size="2"> <p align="left">document.recycle();document=
<font size="2"><font size="2"> <p align="left">viewEntry.recycle(); <p align="left">viewEntry= <font color="#0000c0" size="2"><font color="#0000c0" size="2"> <p align="left">view<font size="2"><font color="#0000c0" size="2"><font color="#0000c0" size="2"> <p align="left">db
<font size="2"><font color="#0000c0" size="2"><font color="#0000c0" size="2"> <p align="left">s
</font></font><font size="2">.recycle();</font><font color="#0000c0" size="2"><font color="#0000c0" size="2">s</font></font><font size="2">=</font><font color="#7f0055" size="2"><font color="#7f0055" size="2">null</font></font><font size="2">;</font></font></font></font><font size="2">.recycle();</font><font color="#0000c0" size="2"><font color="#0000c0" size="2">db</font></font><font size="2">=</font><font color="#7f0055" size="2"><font color="#7f0055" size="2">null</font></font><font size="2">;</font></font></font></font><font size="2">.recycle();</font><font color="#0000c0" size="2"><font color="#0000c0" size="2">view</font></font><font size="2">=</font><font color="#7f0055" size="2"><font color="#7f0055" size="2">null</font></font><font size="2">;</font></font><font color="#7f0055" size="2"><font color="#7f0055" size="2">null</font></font><font size="2">;</font></font></font><font color="#7f0055" size="2"><font color="#7f0055" size="2">null</font></font><font size="2">;</font></font></font></font></font><font color="#0000c0" size="2"><font color="#0000c0" size="2">view</font></font><font size="2">.getEntryByKey(styleCode.trim());</font></font></font><font color="#0000c0" size="2"><font color="#0000c0" size="2">view</font></font><font size="2"> = </font><font color="#0000c0" size="2"><font color="#0000c0" size="2">db</font></font><font size="2">.getView(IMSWebProperties.getInstance().getNotesView());</font></font></font></font><font size="2"> = </font><font color="#0000c0" size="2"><font color="#0000c0" size="2">s</font></font><font size="2">.getDatabase(</font><font color="#2a00ff" size="2"><font color="#2a00ff" size="2">""</font></font><font size="2">,IMSWebProperties.getInstance().getNotesDatabase());</font></font></font></font><font size="2"> = NotesFactory.createSession(</font><font color="#0000c0" size="2"><font color="#0000c0" size="2">lotusServerHost</font></font><font size="2">, </font><font color="#0000c0" size="2"><font color="#0000c0" size="2">serverUserName</font></font><font size="2">, </font><font color="#0000c0" size="2"><font color="#0000c0" size="2">serverPassword</font></font><font size="2">);</font>





