" /> Statserver Java issue: Failed to initialize Java host environment - Genesys CTI User Forum

Author Topic: Statserver Java issue: Failed to initialize Java host environment  (Read 14944 times)

Offline dreamc

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Advertisement
Happy to see the forum is still going strong after so many years (used it a lot probably more than 10 years ago).

I have upgraded the Statserver to version 8.1.000.38, installed the java extensions and configured the options to point to the new java path. I first used jre 1.7, but looking at the documentation found out that it will only work with version 1.4 or 1.5 (and also saw the same in this thread: http://www.sggu.com/smf/index.php?topic=5167.0) . So I have downloaded jre-1_5_0_14 (for linux) and installed it on the server. When starting up the Statserver I get the error Failed to initialize Java host environment.

Within the documentation it says you can use either libjava.so, libjvm.so, libjvm.a, or libjvm.sl. I configured the libjava.so with the right path but I get the following error:
[code]2013-07-05 15:12:04> Init: java-extension-loading-timeout option is set to 20.
2013-07-05 15:12:04> Init: java-extensions-dir option is set to '/appl/genesys/gcti/McStatSrv_8.1.000.38/java/ext' .
2013-07-05 15:12:04> Init: java-libraries-dir option is set to '/appl/genesys/gcti/McStatSrv_8.1.000.38/java/lib' .
2013-07-05 15:12:04> Init: Initializing ITC socket ...
2013-07-05 15:12:04> Init: ITC socket is initialized on port 21000, socket 8
2013-07-05 15:12:04> Init: Error: could not load JVM shared library from path '/appl/genesys/gcti/jre1.5.0_13/lib/amd64/libjava.so'.
2013-07-05 15:12:04> Init: Error description: libjvm.so: cannot open shared object file: No such file or directory
2013-07-05T15:12:04.749 Std 10012 Failed to initialize Java host environment
2013-07-05 15:12:04> Init: Error: Java host environment initialization failed
[/code]

Trying libjava.so results in a crash of the statserver with logging not even showing the initialisation of the java environment. I have tried different 1.5 versions, all with the same result.

Now the documentation mentions that jvm-option needs to be configured (which doesn't seem to be have done previously), but it is unclear to me which values should be specified there.

Can anyone help me solve this issue?

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Statserver Java issue: Failed to initialize Java host environment
« Reply #1 on: July 05, 2013, 03:35:47 PM »
StatServer has 2 states. On the logs the first appearance will be that it can't load it. But wait a few seconds and after all stats are loaded then you will see another Java message that it is ok.
Don't forget to define also JAVA_HOST
Best way is to go on CCPulse and use some Java Stat

Offline dreamc

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: Statserver Java issue: Failed to initialize Java host environment
« Reply #2 on: July 08, 2013, 05:45:27 AM »
The "Java Host Environment is not initialized" message keeps appearing all through the logs, so it seems it doesn't start working. The server was supplied by another party with java 1.7 pre-installed. As I don't know if there are any other processes running on the machine which might need that version I thought changing JAVA_HOME might be tricky (unless I need to/can change it somewhere else).

Offline Timur Karimov

  • Sr. Member
  • ****
  • Posts: 415
  • Karma: 2
Re: Statserver Java issue: Failed to initialize Java host environment
« Reply #3 on: July 08, 2013, 06:53:35 AM »
[quote author=dreamc link=topic=7885.msg34428#msg34428 date=1373262327]
The "Java Host Environment is not initialized" message keeps appearing all through the logs, so it seems it doesn't start working. The server was supplied by another party with java 1.7 pre-installed.
[/quote]
Whats exactly why everyone must read the deployment guide and test you setup in lab environment!  Stat Server supports now support only the JDK version 1.4 or 1.5

Offline dreamc

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: Statserver Java issue: Failed to initialize Java host environment
« Reply #4 on: July 08, 2013, 07:32:53 AM »
This is the lab environment, so no issues yet where it really matters. I'm trying to prevent them before it is too late. I installed the jre 1.5 manually, but since I can't do anything myself to the settings on Linux (pretty much locked down) I had hoped configuring in Statserver would be sufficient. So I guess I'll have to ask the sysadmin to change settings.

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Statserver Java issue: Failed to initialize Java host environment
« Reply #5 on: July 08, 2013, 12:42:44 PM »
:S Well that is another important step, you need admin privileges to configure it correctly.

Offline dreamc

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: Statserver Java issue: Failed to initialize Java host environment
« Reply #6 on: July 10, 2013, 09:27:36 AM »
Have now been able to set the JAVA_HOME, PATH and LD_LIBRARY_PATH

JAVA_HOME is now set:
[code]/appl/genesys/gcti/jre1.5.0_14[/code]

PATH now includes:
[code]/appl/genesys/gcti/jre1.5.0_14/bin[/code]

LD_LIBRARY_PATH now includes
[code]/appl/genesys/gcti/jre1.5.0_14/bin[/code]

When I set the JVM path in the options like this:
/appl/genesys/gcti/jre1.5.0_14/lib/amd64/libjava.so
I see the error message that the file can not be opened:
[code]2013-07-10T11:12:04.849 Std 06053 Configuration for application obtained
2013-07-10 11:12:04> Init: java-debug option is set to 'on'.
2013-07-10 11:12:04> Init: java-extension-loading-timeout option is set to 20.
2013-07-10 11:12:04> Init: java-extensions-dir option is set to '/appl/genesys/gcti/McStatSrv_8.1.000.38/java/ext' .
2013-07-10 11:12:04> Init: java-libraries-dir option is set to '/appl/genesys/gcti/McStatSrv_8.1.000.38/java/lib' .
2013-07-10 11:12:04> Init: Initializing ITC socket ...
2013-07-10 11:12:04> Init: ITC socket is initialized on port 21000, socket 8
2013-07-10 11:12:04> Init: Error: could not load JVM shared library from path '/appl/genesys/gcti/jre1.5.0_14/lib/amd64/libjava.so'.
2013-07-10 11:12:04> Init: Error description: libjvm.so: cannot open shared object file: No such file or directory
2013-07-10T11:12:04.849 Std 10012 Failed to initialize Java host environment
2013-07-10 11:12:04> Init: Error: Java host environment initialization failed[/code]
After this 'Java Host Environment is not initialized' keeps appearing through the logs.

If I configure the option to /appl/genesys/gcti/jre1.5.0_14/lib/amd64/server/libjvm.so the application crashes almost immediately while adding Queues and Agents (and the log shows no reference to anything Java related)

Looking at the statserver deployment guide (the high-level procedure when starting up) I see that Stat Server verifies that the jvm-options section exists (but in the next step it says it is only used if anything is specified), so I'm wondering if I might need to configure something there (but since I see it trying to start the environment I don't think it is a must to be there).

Offline Timur Karimov

  • Sr. Member
  • ****
  • Posts: 415
  • Karma: 2
Re: Statserver Java issue: Failed to initialize Java host environment
« Reply #7 on: July 10, 2013, 09:40:54 AM »
You need JDK not the JRE

Offline René

  • Administrator
  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 62
Re: Statserver Java issue: Failed to initialize Java host environment
« Reply #8 on: July 10, 2013, 10:04:40 AM »
Hi dreamc,

You have to use 32bit Java and not 64bit as StatServer is 32bit app.

JRE is sufficient for StatServer.

R.

Offline dreamc

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: Statserver Java issue: Failed to initialize Java host environment
« Reply #9 on: July 10, 2013, 10:29:29 AM »
Thanks, will try the jre-1_5_0_14-linux-i586.bin package and see if this solves the issue.

Offline dreamc

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: Statserver Java issue: Failed to initialize Java host environment
« Reply #10 on: July 10, 2013, 10:59:55 AM »
Just installed it and running this version gives the following:

[code]2013-07-10 12:53:19> Init: ITC socket is initialized on port 21000, socket 8
2013-07-10 12:53:19> Init: Error: could not load JVM shared library from path '/appl/genesys/gcti/jre1.5.0_14/lib/i386/libjava.so'.
2013-07-10 12:53:19> Init: Error description: /appl/genesys/gcti/jre1.5.0_14/lib/i386/libjava.so: wrong ELF class: ELFCLASS32
2013-07-10T12:53:19.496 Std 10012 Failed to initialize Java host environment
2013-07-10 12:53:19> Init: Error: Java host environment initialization failed[/code]

The same thing happens when I configured the libjvm.so
[code]2013-07-10 12:58:15> Init: java-extension-loading-timeout option is set to 20.
2013-07-10 12:58:15> Init: java-extensions-dir option is set to '/appl/genesys/gcti/McStatSrv_8.1.000.38/java/ext' .
2013-07-10 12:58:15> Init: java-libraries-dir option is set to '/appl/genesys/gcti/McStatSrv_8.1.000.38/java/lib' .
2013-07-10 12:58:15> Init: Initializing ITC socket ...
2013-07-10 12:58:15> Init: ITC socket is initialized on port 21000, socket 8
2013-07-10 12:58:15> Init: Error: could not load JVM shared library from path '/appl/genesys/gcti/jre1.5.0_14/lib/i386/server/libjvm.so'.
2013-07-10 12:58:15> Init: Error description: /appl/genesys/gcti/jre1.5.0_14/lib/i386/server/libjvm.so: wrong ELF class: ELFCLASS32
2013-07-10T12:58:15.364 Std 10012 Failed to initialize Java host environment
2013-07-10 12:58:15> Init: Error: Java host environment initialization failed[/code]

Looking at the statserver directory we are running the 64 bit version (version 8.1.00.38), within the statserver directory there is a symlink which points statserv to statserv_64

*UPDATE* In order to test if it would work with the 32 bit version of java I have forced it to start up with statserv_32 and then the jvm initiates succesfully. Looking at the release notes of version 8.1.00.39 it states as new functionality "Support for the Red Hat Enterprise Linux 6 64-bit native", which is strange to me.
« Last Edit: July 10, 2013, 11:20:49 AM by dreamc »

Offline René

  • Administrator
  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 62
Re: Statserver Java issue: Failed to initialize Java host environment
« Reply #11 on: July 10, 2013, 12:15:59 PM »
Hi,

I forgot that 64bit native StatServer application is available now. In that case you need 64bit JRE.

I did quick test on my lab platform (CentOS 5.9, Stat Server 8.1.000.37 - 64bit image) and it works properly with JRE 1.5_22 64bit. The 'jvm-path' option is set to '/usr/java/jre1.5.0_22_x64/lib/amd64/server/libjvm.so'

R.


Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Statserver Java issue: Failed to initialize Java host environment
« Reply #12 on: July 10, 2013, 01:00:11 PM »
[quote author=René link=topic=7885.msg34490#msg34490 date=1373458559]
CentOS 5.9
[/quote]

Sorry guys to break the post but just curious René, any special reason to use CentOS 5.9 and not 6.x?

Offline dreamc

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: Statserver Java issue: Failed to initialize Java host environment
« Reply #13 on: July 10, 2013, 01:09:33 PM »
Thank you for the quick test.

Installed that same version, JRE 1.5_22 64 bit, and changed the 'jvm-path' to the same libjvm.so as you've used, but when starting the application it crashes (my statserver version is  8.1.00.38) before I even see it trying to start up the JVM. We're running Redhat Linux.

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Statserver Java issue: Failed to initialize Java host environment
« Reply #14 on: July 10, 2013, 01:56:51 PM »
Logs logs