Newsgroup: it.comp.appl.notes-domino
Titolo: I can't create a Session in web browser (using Corba)

Hello, (sorry, I can't speak in Italian :o) )
I'm trying to open a database in a remote application, but I'm not able
to create a session !
The code of the application lies here :
//--------------
import lotus.domino.*;
public class essai
{
 public static void main(String argv[])
 {
  try{
   String ior = NotesFactory.getIOR("192.168.0.125");
   Session s = NotesFactory.createSessionWithIOR(ior);
   String user = s.getUserName();
   String platform = s.getPlatform();
   System.out.println(user + "   " + platform);
  }
  catch(NotesException e)
  {
   e.printStackTrace();
   System.out.println("ERROR : " + 
e.id
 +"   "+e.text);
  }
 }
}
//--------------
When I launch this, the result is :
lotus.domino.NotesException
 at lotus.domino.NotesExceptionHelper.read(NotesExceptionHelper.java:48)
 at
lotus.domino.NotesExceptionHolder._read(NotesExceptionHolder.java:25)
 at com.ibm.CORBA.iiop.RepImpl.invoke(RepImpl.java, Compiled Code)
 at com.ibm.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:36)
 at
lotus.domino.corba._IObjectServerStub.createSession(_IObjectServerStub.java:154)
 at lotus.domino.cso.Session.OREFtoSession(Session.java:557)
 at lotus.domino.cso.Session.<init>(Session.java:577)
 at lotus.domino.cso.Session.createSession(Session.java:23)
 at lotus.domino.NotesFactory.createSessionWithIOR(NotesFactory.java:99)
 at lotus.domino.NotesFactory.createSessionWithIOR(NotesFactory.java:83)
 at essai.main(essai.java:9)
ERROR : 4536 Accès serveur refusé
ior :
IOR:010000002900000049444c3a6c6f7475732f646f6d696e6f2f636f7262612f494f626a6563745365727665723a312e30000000000010000000000000054000000010101000e0000003139322e3136382e302e31323500acf6310000000438353235363531612d656336382d313036632d656565302d303037653264323233336235004c6f7475734e4f4901000100000000000000
----
(The French line means ERROR : 4536 Server Acess Denied)
The administrator of the server told me that the http and diiop tasks
were launched.
I know the error occurs when I'm trying to create a session because the
application displeys the ior the server returned me.
I also tryied the same program in an applet and the result is the same.
Then I replaced :
                String ior = NotesFactory.getIOR("192.168.0.125");
                Session s = NotesFactory.createSessionWithIOR(ior);
by :
                Session s = this.getSession();
It still doesn't work and this time the error returned by
NotesException.id and NotesException.text is :
4530 Le cookie a mappé l'utilisateur depuis une autre adresse IP
(wich means : the cookie matched the user from another IP adress)
I checked that the "applet using Corba" box was checked.
If someone knows a clue to solve these error I will be very grateful to
him !
Thanks.
Christophe Meneboeuf
c.men...@caramail.com

I had a problem like your.
There's a very simple solution but I don't remember that.
I'll try to find-out the solution from my notes. ;-)

FOUND!
You have to invoke the static method NotesThread.sinitThread() before all
operations.
That method initializes the NOI java environment.
Be shure to invoke NotesThread.stermThread() at the end of your program.
I know it can seem strange but you don't use the NotesThread object you even
have to use it's initialization methods to make NOI running.
Keep in touch boy! ;-)