"Mladen Turk" <[EMAIL PROTECTED]> wrote on 30.12.2002 19:25:01:
>
> > >
> > > Looks to me like that you are using the wrong JVM.
> > >
> > The strange thing is, that this only happens when using
> > Domino 6 and not when using Domino 5 with the same JVM path
> > and DSAPI filter. I extracted the relevant code from
> > 'jk_jni_worker.c' and found the mentioned "JNI_CreateJavaVM"
> > call to be the problem. I tried it with JDK/JRE 1.3.1_06 and
> > JDK/JRE 1.4.1_01 and got the same results :( Can there be any
> > class-path or system-path related issues, which might be
> > handled different from Domino 5 to 6? Any other ideas or hints?
> >
>
> Seems that Domino 6 is using its own JVM (think that the one (IBM 1.3.1)
> comes with installation) and you have collision problem cause you are
> loading another JVM in the process.

You are right, from the Domino 6 Java directory and the jvm.dll I got this
string "J2RE 1.3.1 IBM Windows 32 build cn131-20020515". Domino 5.0.11 has
a javai.dll with the version string "1.1.8_008_Iris" in it.

> There could be a problem with that if Domino already loads JVM, cause
> you can load JVM only once per process.  We'll need to change some calls
> to JNI to attach to already created JVM. I'll try to do that (for JK2).

Ok, I understand what the problem is most likely. If I try to load the JVM
of Domino 6 I get the 'error', that the JVM already exists. If one would
use this JVM, the problem is that you may not have any or at least
restricted control over startup options (see below) and if, they must be
specified in notes.ini for example as JavaUserClasses with a limit of 255
chars. And what might be a problem too is that you are bound to the JDK
version which is delivered with Domino. But it would be much better this
way than not be able to use it at all, so I would appreciate! if you could
do/integrate this. (See below some code I would suggest for the problem of
discovering a loaded JVM for windows, what do you think?)

I looked into the documentation of notes.ini variables which allow to
configure the included JVM. There seems to be no documented way to set
custom options like -Dtomcat-home=... and so on. On the other hand you can
set the classpath and heap/stack sizes (for reference see
http://www-10.lotus.com/ldd/today.nsf/54dd141eed99bf278525697a00561a66/e94d1b96f50fce5685256af6006299da?OpenDocument
 and
http://www-10.lotus.com/ldd/today.nsf/54dd141eed99bf278525697a00561a66/2d5fefbb43ffff7a00256c410047a793?OpenDocument)

By the way: I changed my test code to create a JVM based on a JDK 1.1.8
which I have installed on my machine. That worked without any problems, but
obviously gets me nowhere. On the other hand under Domino 5 a JVM is also
already loaded when the connector is creating another JVM, but perhaps the
Domino JVM 1.1.8 is more "forgiving".

> Do you have some tools (like Process Explorer from SysInternals?) so you
> can tell if the JVM is already loaded and what is the version.

I used Process Explorer and found what I described in the sections above.
Domino 6 loads the JVM in "Lotus\Domino\jvm\bin" but Domino 5 loads JVM
(javai.dll) in its programm directory as well.

> MT.

Olaf

This code enumerates all moduls loaded by a process and if jvm.dll is found
gives back the complete path and filename. I have tested it shortly and it
did the job for me very well.

static char* findAlreadyLoadedJVM()
{
      static char jvm[MAX_PATH+1];
      HANDLE hSnapshot;
      MODULEENTRY32 lpme;
      BOOL err;

      // Create snapshot for all moduls loaded by the current process
      hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, 0);
      lpme.dwSize = sizeof(MODULEENTRY32);

      err = Module32First(hSnapshot, &lpme);
      while (err)
      {
            // compare if modul-name is a loaded JVM
            if (_stricmp("jvm.dll", lpme.szModule) == 0)
            {
                  // copy path and file-name, close handle and return jvm
                  strcpy(jvm, lpme.szExePath);
                  CloseHandle(hSnapshot);
                  return jvm;
            }
            err = Module32Next(hSnapshot, &lpme);
      }
      CloseHandle(hSnapshot);

      // no loaded JVM found
      return NULL;
}



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to