Menu

#89 Service could not find any suitable Java Virtual Machine

open
Wrapper (39)
5
2010-10-06
2010-10-06
No

On some windows systems (XP, 7 64-bit 32-bit) the service wrapper quits with the message "ERROR: could not find any suitable Java Virtual Machine" (in service.txt) although a jvm is installed. The funny thing is that this doesn't happen in all cases but in some. I couldn't determine the cause yet - maybe it has something to do with new JVMs and where the information about their installation directory is stored? Hopefully this could be fixed. If needed I could provide some of my time to help finding this bug ...

Discussion

  • Paul van Bemmelen

    Is there any more news on this bug?

    I'm having the same problem on XP (I'm running Windows XP using Virtual PC, on top of my Windows 7 operating system).

    When I start the service, the relevant part of the logfile of the service shows:

    12:50.42 :Now searching the JVM installed on the system...
    12:50.42 :JVM Lookup: found VM (V(1)(6)(0)) in registry.
    12:50.42 :JVM Lookup: found VM (V(1)(6)(0)) in registry.
    12:50.42 :JVM Lookup: Env-Var JAVA_HOME not defined on this system.
    12:50.42 :JVM Lookup: Env-Var JRE_HOME not defined on this system.
    12:50.42 :JVM Lookup: Env-Var JDK_HOME not defined on this system.
    12:50.42 :Current directory is C:\p.vanbemmelen\rb-rte\
    12:50.42 :set status 4 (SERVICE_RUNNING)
    12:50.42 :DLL VM will be tried in the following order: 1.6.0;1.6.0;
    12:50.42 :- Trying registry: <C:\Programs\Java\jre6><C:\Programs\Java\jre6\bin\c
    lient\jvm.dll><1.6.0>
    12:50.42 :Running now <C:\Programs\Java\jre6><C:\Programs\Java\jre6\bin\client\j
    vm.dll><1.6.0>, instanciate=yes
    12:50.42 :Launching <C:\Programs\Java\jre6><C:\Programs\Java\jre6\bin\client\jvm
    .dll><1.6.0>
    12:50.42 :RuntimeLibPath used: C:\Programs\Java\jre6\bin\client\jvm.dll
    12:50.42 :Saving jnismoothjar in C:\WINDOWS\TEMP\temp0.jar
    12:50.42 :Created temporary filename to hold the jar (C:\WINDOWS\TEMP\temp0.jar)
    12:50.42 :ClassPath element is C:\p.vanbemmelen\rb-rte\ + rbserver.jar
    12:50.42 :ClassPath element 0=C:\p.vanbemmelen\rb-rte\rbserver.jar
    12:50.42 :- Trying registry: <C:\Programs\Java\jre6><C:\Programs\Java\jre6\bin\c
    lient\jvm.dll><1.6.0>
    12:50.42 :Running now <C:\Programs\Java\jre6><C:\Programs\Java\jre6\bin\client\j
    vm.dll><1.6.0>, instanciate=yes
    12:50.42 :Launching <C:\Programs\Java\jre6><C:\Programs\Java\jre6\bin\client\jvm
    .dll><1.6.0>
    12:50.42 :RuntimeLibPath used: C:\Programs\Java\jre6\bin\client\jvm.dll
    12:50.42 :Saving jnismoothjar in C:\WINDOWS\TEMP\temp1.jar
    12:50.42 :Created temporary filename to hold the jar (C:\WINDOWS\TEMP\temp1.jar)
    12:50.42 :ClassPath element is C:\p.vanbemmelen\rb-rte\ + rbserver.jar
    12:50.42 :ClassPath element 0=C:\p.vanbemmelen\rb-rte\rbserver.jar
    12:50.42 :ERROR: could not find any suitable Java Virtual Machine

    Why the ERROR on the last line, when earlier lines show that it found an jvm ?

    Any workaround would be appreciated.

    Paul van Bemmelen.

     
  • Paul van Bemmelen

    Once more the relevant part of the logfile, but this time with correct linewrapping :
    12:50.42 :Now searching the JVM installed on the system...
    12:50.42 :JVM Lookup: found VM (V(1)(6)(0)) in registry.
    12:50.42 :JVM Lookup: found VM (V(1)(6)(0)) in registry.
    12:50.42 :JVM Lookup: Env-Var JAVA_HOME not defined on this system.
    12:50.42 :JVM Lookup: Env-Var JRE_HOME not defined on this system.
    12:50.42 :JVM Lookup: Env-Var JDK_HOME not defined on this system.
    12:50.42 :Current directory is C:\p.vanbemmelen\rb-rte\
    12:50.42 :set status 4 (SERVICE_RUNNING)
    12:50.42 :DLL VM will be tried in the following order: 1.6.0;1.6.0;
    12:50.42 :- Trying registry: <C:\Programs\Java\jre6><C:\Programs\Java\jre6\bin\client\jvm.dll><1.6.0>
    12:50.42 :Running now <C:\Programs\Java\jre6><C:\Programs\Java\jre6\bin\client\jvm.dll><1.6.0>, instanciate=yes
    12:50.42 :Launching <C:\Programs\Java\jre6><C:\Programs\Java\jre6\bin\client\jvm.dll><1.6.0>
    12:50.42 :RuntimeLibPath used: C:\Programs\Java\jre6\bin\client\jvm.dll
    12:50.42 :Saving jnismoothjar in C:\WINDOWS\TEMP\temp0.jar
    12:50.42 :Created temporary filename to hold the jar (C:\WINDOWS\TEMP\temp0.jar)
    12:50.42 :ClassPath element is C:\p.vanbemmelen\rb-rte\ + rbserver.jar
    12:50.42 :ClassPath element 0=C:\p.vanbemmelen\rb-rte\rbserver.jar
    12:50.42 :- Trying registry: <C:\Programs\Java\jre6><C:\Programs\Java\jre6\bin\client\jvm.dll><1.6.0>
    12:50.42 :Running now <C:\Programs\Java\jre6><C:\Programs\Java\jre6\bin\client\jvm.dll><1.6.0>, instanciate=yes
    12:50.42 :Launching <C:\Programs\Java\jre6><C:\Programs\Java\jre6\bin\client\jvm.dll><1.6.0>
    12:50.42 :RuntimeLibPath used: C:\Programs\Java\jre6\bin\client\jvm.dll
    12:50.42 :Saving jnismoothjar in C:\WINDOWS\TEMP\temp1.jar
    12:50.42 :Created temporary filename to hold the jar (C:\WINDOWS\TEMP\temp1.jar)
    12:50.42 :ClassPath element is C:\p.vanbemmelen\rb-rte\ + rbserver.jar
    12:50.42 :ClassPath element 0=C:\p.vanbemmelen\rb-rte\rbserver.jar
    12:50.42 :ERROR: could not find any suitable Java Virtual Machine

    Note: It shows the lines starting with "Trying registry" twice.
    Seems bit strange.

     
  • pavon

    pavon - 2011-11-14

    This was happening to me on Windows Server 2008 R2 64-bit, with Java 1.6.0_27 64-bit JRE and JDK installed. I was able to resolve it by installing a 32-bit JVM. Don't know why JSmooth wouldn't use the 64-bit JVM.

     
  • Paul van Bemmelen

    I found out what the cause is of the problem I described in my earlier comment.

    In

    bool SunJVMDLL::instanciate()

    the statement

    m_vmlib = LoadLibrary(m_dllpath.c_str());

    fails, because the jre bin dir is not in the PATH environment variable.

    When just before the LoadLibrary statement, I add the value of jre bin to the PATH enviroment variable, like so,

    char buffer[512];
    DWORD rv = GetEnvironmentVariable("PATH", buffer, 512);
    string valueNew = string(buffer) + ";C:\\Program Files\\Java\\jre6\\bin" ;
    SetEnvironmentVariable("PATH" , valueNew.c_str());

    then the problem is solved.

    Here I have hardcoded the value for the jre bin dir ; I still have to find out how to get that value from elsewhere within the JSmooth code.

     

Log in to post a comment.

MongoDB Logo MongoDB