Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: dreamc on July 05, 2013, 02:41:20 PM

Title: Statserver Java issue: Failed to initialize Java host environment
Post by: dreamc on July 05, 2013, 02:41:20 PM
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?
Title: Re: Statserver Java issue: Failed to initialize Java host environment
Post by: cavagnaro 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
Title: Re: Statserver Java issue: Failed to initialize Java host environment
Post by: dreamc 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).
Title: Re: Statserver Java issue: Failed to initialize Java host environment
Post by: Timur Karimov 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
Title: Re: Statserver Java issue: Failed to initialize Java host environment
Post by: dreamc 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.
Title: Re: Statserver Java issue: Failed to initialize Java host environment
Post by: cavagnaro on July 08, 2013, 12:42:44 PM
:S Well that is another important step, you need admin privileges to configure it correctly.
Title: Re: Statserver Java issue: Failed to initialize Java host environment
Post by: dreamc 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).
Title: Re: Statserver Java issue: Failed to initialize Java host environment
Post by: Timur Karimov on July 10, 2013, 09:40:54 AM
You need JDK not the JRE
Title: Re: Statserver Java issue: Failed to initialize Java host environment
Post by: René 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.
Title: Re: Statserver Java issue: Failed to initialize Java host environment
Post by: dreamc 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.
Title: Re: Statserver Java issue: Failed to initialize Java host environment
Post by: dreamc 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.
Title: Re: Statserver Java issue: Failed to initialize Java host environment
Post by: René 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.

Title: Re: Statserver Java issue: Failed to initialize Java host environment
Post by: cavagnaro 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?
Title: Re: Statserver Java issue: Failed to initialize Java host environment
Post by: dreamc 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.
Title: Re: Statserver Java issue: Failed to initialize Java host environment
Post by: cavagnaro on July 10, 2013, 01:56:51 PM
Logs logs
Title: Re: Statserver Java issue: Failed to initialize Java host environment
Post by: dreamc on July 11, 2013, 07:44:11 AM
I see the following in the snapshot log :

[code]2013-07-10T15:05:14.712 Std 06053 Configuration for application obtained
2013-07-10 15:05:14> Init: java-debug option is set to 'on'.
2013-07-10 15:05:14> Init: java-extension-loading-timeout option is set to 20.
2013-07-10 15:05:14> Init: java-extensions-dir option is set to '/appl/genesys/gcti/McStatSrv_8.1.000.38/java/ext' .
2013-07-10 15:05:14> Init: java-libraries-dir option is set to '/appl/genesys/gcti/McStatSrv_8.1.000.38/java/lib' .
2013-07-10 15:05:14> Init: Initializing ITC socket ...
2013-07-10 15:05:14> Init: ITC socket is initialized on port 21000, socket 8

Starting Java...

java version "1.5.0_22"
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_22-b03)

2013-07-10T15:05:14.767 Std 10008 Loaded Java Virtual Machine from '/appl/genesys/gcti/jre1.5.0_22/lib/amd64/server/libjvm.so'
2013-07-10 15:05:14> Java: Initialized class-loader from './java/ssjcldr.class', version "1.3"
2013-07-10 15:05:14> Java:
Manifest of [./java/statserver.jar]
{
Specification-Title:   "StatServer Java SDK Classes"
Class-Path:             kv65_adapter.jar kvlists.jar
Created-By: 1.5.0_05 (Sun Microsystems Inc.)
Implementation-Title:   "com.genesys.statserver"
Specification-Version: "1.11"
Specification-Vendor:   "Genesys Telecommunications Laboratories, Inc."
Manifest-Version: 1.0
Implementation-Version: "1.0"
Implementation-Vendor: "Genesys Telecommunications Laboratories, Inc."
}
2013-07-10 15:05:14> Java:
Manifest of [./java/statserver_impl.jar]
{
Specification-Title:   "StatServer internal Java Host Environment classes"
Class-Path:             kv65_adapter.jar kvlists.jar statserver.jar
Created-By: 1.5.0_05 (Sun Microsystems Inc.)
Implementation-Title:   "com.genesys.statserver_impl"
Specification-Version: "1.11"
Specification-Vendor:   "Genesys Telecommunications Laboratories, Inc."
Manifest-Version: 1.0
Implementation-Version: "1.0"
Implementation-Vendor: "Genesys Telecommunications Laboratories, Inc."
}
2013-07-10 15:05:14> Java: Loading extension 'VCBStatExtension.jar'...
Unable to resolve path 'VCBStatExtension.jar'
2013-07-10 15:05:14> Init: Extension 'VCBStatExtension.jar' cannot be loaded
2013-07-10 15:05:14> Java: Loading extension 'eServiceContactStat.jar'...
2013-07-10 15:05:14> Java: Registered extension '/appl/genesys/gcti/McStatSrv_8.1.000.38/java/ext/eServiceContactStat.jar' on ITC socket
2013-07-10 15:05:14> Java:
Manifest of [/appl/genesys/gcti/McStatSrv_8.1.000.38/java/ext/eServiceContactStat.jar]
{
Specification-Title:   "Genesys MCR UCS Extension"
Internal-Version: "8.1.000.00"
Class-Path: dsw_transformers.jar dsw_extension_core.jar dsw_api_java.jar
Created-By: 1.5.0_07 (Sun Microsystems Inc.)
Main-Class: com/genesys/eservice/extensions/_ucs_extension
Implementation-Title:   "com.genesys.eservice.extensions"
Specification-Version: "1.0"
Specification-Vendor:   "Genesys Telecommunications Laboratories, Inc."
Manifest-Version: "1.0"
Implementation-Version: "8.1.000.00"
Implementation-Vendor: "Genesys Telecommunications Laboratories, Inc."
}
@07/10/13 15:05:14.9454 (nco) Signal SIGSEGV received
-- Call stack dump --
0x006ebb98  + 0x6ebb98 [./statserv]
0x006ebd33  + 0x6ebd33 [./statserv]
0x006ebafc  + 0x6ebafc [./statserv]
0x2aaaab29b5ff  + 0x2aaaab29b5ff [/appl/genesys/gcti/jre1.5.0_22/lib/amd64/server/libjvm.so]
0x2aaaab29995b  + 0x2aaaab29995b [/appl/genesys/gcti/jre1.5.0_22/lib/amd64/server/libjvm.so]
0x2aaaab29bc69 JVM_handle_linux_signal + 0x1a9 [/appl/genesys/gcti/jre1.5.0_22/lib/amd64/server/libjvm.so]
0x2aaaab29986e  + 0x2aaaab29986e [/appl/genesys/gcti/jre1.5.0_22/lib/amd64/server/libjvm.so]
0x2b835e748be0  + 0x2b835e748be0 [/lib64/libpthread.so.0]
0x2aaaab0bfc5f  + 0x2aaaab0bfc5f [/appl/genesys/gcti/jre1.5.0_22/lib/amd64/server/libjvm.so]
0x004d734d  + 0x4d734d [./statserv]
0x0041c46a  + 0x41c46a [./statserv]
0x0041ecd5  + 0x41ecd5 [./statserv]
0x004209ab  + 0x4209ab [./statserv]
0x0053b0c2  + 0x53b0c2 [./statserv]
0x0053b163  + 0x53b163 [./statserv]
0x0053b258  + 0x53b258 [./statserv]
0x2b835e74077d  + 0x2b835e74077d [/lib64/libpthread.so.0]
0x2b835f1bac1d clone + 0x6d [/lib64/libc.so.6]
-- end of dump --[/code]

It then starts adding agent to the VAGs and crashes:
[code]2013-07-10 15:05:14> Init: Creating Agents Group 'STAGENTS'('Resources')
2013-07-10 15:05:14> Init: Adding Agent 'AG030[/code]
Title: Re: Statserver Java issue: Failed to initialize Java host environment
Post by: cavagnaro on July 11, 2013, 05:06:03 PM
Well just subversion 39 says:

Support for the Red Hat Enterprise Linux 6 64-bit native.

So not sure if your case...
Title: Re: Statserver Java issue: Failed to initialize Java host environment
Post by: dreamc on July 15, 2013, 12:09:36 PM
Me neither, I guess I will have to run it in 32-bit mode for now.