Skip to main content

How to enable a Java HotSpot Server VM inside the Artix it_container

  • May 17, 2013
  • 0 replies
  • 0 views

Summary How to enable a Java HotSpot Server VM inside the Artix it_container
Article Number 26114
Environment Artix 5.x
Solaris
Question/Problem Description Typically the Artix it_container starts a Java HotSpot Client VM as an embedded VM for running java plugins deployed inside the container.

For optimization reasons it might be desired to replace the Java HotSpot Client VM with a Java HotSpot Server VM.
Clarifying Information Which JVM shlib is loaded inside the Artix it_container is controlled by the shared library search path for the OS, in case of Solaris, LD_LIBRARY_PATH.

Use the following command to find out which JVM shared library is loaded into the it_container process:
>pldd <container PID> | grep libjvm.so
Error Message Trying the load the Java Hotspot Server VM through the -server parameter in the jvm_options configuration variable crashes the Artix process with the folowing stack trace:
----------------- lwp# 1 / thread# 1 --------------------
fb5b7478 __1cMIT_JNI_UtilsMJNIEnvHolder2t5B6MpnHJavaVM___v_ (ffbfcea8, 0, 3, 124e4, 763c0e65, 10000) 2c
fb73c668 __1cWIT_Generic_Java_PluginUGenericJavaBusPlugIn2t5B6MpnGIT_BusDBus__v_ (1520c0, fef3222c, 30, 13dc10, 156bf0, fb7527b0) 278
fb73c37c __1cWIT_Generic_Java_PluginbBGenericJavaBusPlugInFactoryRcreate_bus_plugin6MpnGIT_BusDBus__pn0CJBusPlugIn__ (1520c0, 13dc08, fb7527fc, 0, ff32c038, fb73c36c) 10
fee075a4 __1cGIT_BusRPerBusPlugInState2t6MpnFCORBAGIT_ORB_pkcrn0AQBusPlugInFactory__v_ (152440, b6af8, 154100, fb7526e0, 152444, ff08b64c) 168
fee0956c __1cGIT_BusMBusORBPlugInIORB_init6MpnFCORBAGIT_ORB__pnMIT_ORBPlugInLPerORBState__ (fb7526e8, b6af8, 156650, ff08ccf4, 152440, 154100) 50
fdb3cdcc __1cOIT_ORB_ORBImplLinit_plugin6MrnJIT_Locker4nIIT_Mutex___pkc_b_ (b6af8, ffbfd244, 102368, 156654, ffbfd1a0, ffbfd1c4) 43c
fdb3c938 __1cOIT_ORB_ORBImplLinit_plugin6Mpkc_b_ (b6af8, 102368, 8, 570260, fdd86630, 4000) 4c
fdb406b0 __1cOIT_ORB_ORBImplKinitialize6Mrippc_v_ (b6af8, ffbfd3c4, ffbfd3d0, fe0c25ae, ffbfd408, 1) b40
fdb4e520 __1cRIT_ORB_ORBManagerOcreate_new_orb6Mrippcpkc_pnOIT_ORB_ORBImpl__ (b50a0, ffbfd920, b5048, 0, 55e694, b6af8) 68 
fdb4ec4c __1cRIT_ORB_ORBManagerJORBLoaderEload6MrknLIT_FWString__b_ (ffbfd640, ffbfd64c, 400, 3990c, ff2ec330, b2de0) 4c
fdb4fb98 __1cUIT_OnDemandObjectMap4nLIT_FWString_CpnOIT_ORB_ORBImpl_nRIT_ORB_ORBManagerJORBLoader_nPIT_FWStringHash_nNIT_FWStringEq__Lload_object6MrnJIT_Locker4nIIT_Mutex___rkn0A_pnXIT_OnDemandObjectHolder4C1__pn0D__b_ (b50a4, ffbfd634, ffbfd64c, b3848, ffbfd640, 0) 80
fdb4f1c8 __1cUIT_OnDemandObjectMap4nLIT_FWString_CpnOIT_ORB_ORBImpl_nRIT_ORB_ORBManagerJORBLoader_nPIT_FWStringHash_nNIT_FWStringEq__Lfind_object6MrnJIT_Locker4nIIT_Mutex___rkn0A_r1pn0D__b_ (b50a4, ffbfd634, ffbfd64c, ffbfd630, ffbfd640, b50a4) b8
fdb4e250 __1cRIT_ORB_ORBManagerOinitialize_orb6Mrippcpkc_pnOIT_ORB_ORBImpl__ (b50a0, ffbfd920, b5048, fdfd74ee, 55e98c, fdb4e858) 94
fdb4e0a0 __1cFCORBAIORB_init6Frippcpkc_pn0ADORB__ (ffbfd920, 0, fdfd74ee, fdfd74d4, fe0acb58, b5048) 138
fef2ae48 __1cGIT_BusHBusImplEinit6Frippcpkc_n0ADVar4n0ADBus____ (ffbfd88c, ffbfd920, b5048, 18a6d, ffbfd724, 0) 308
00015ed0 __1cPIT_Bus_ServicesNGenericServerMActionsPOSIXJbe_daemon6Mippc_i_ (0, 2a374, b5048, 4, 3f7a0, 3) 588
00013050 main (11, b5048, ffbfda24, 15d5c, 16ab8, 0) 100
00012f28 _start (0, 0, 0, 0, 0, 0) 108
Defect/Enhancement Number ART-11041
Cause The reason why the Java Hotspot Server VM cannot be loaded through the -server option in the jvm_options configuration variable is because it controls which JVM shared library to load, but but the time jvm_options come into play in an Artix process, the Artix process has already loaded a JVM shared library.
Resolution pldd <container PID> | grep libjvm.so

In case of the Java HotSpot Client VM the command "pldd <container PID> | grep libjvm.so" will print out somethig similar to the line below, containing the libjvm.so from the client directory.
/usr/jdk/instances/jdk1.5.0/jre/lib/i386/client/libjvm.so

In order to enable the Java Hotspot Server VM the server directory needs to be included on the LD_LIBRARY_PATH in front of the client directory, eg the following directory needs to be prepended to the existing LD_LIBRARY_PATH:
/usr/jdk/jdk1.5.0_14/jre/lib/i386/server

Further JVM options can be configured through the jvm_options Artix configuration variable. For further information  please see: Artix ESB Configuring and Deploying Artix Solutions, C Runtime.

What options are acceptable is described in the documentation for the JNI_CreateJavaVM() function for the JVM in question, for example, at http://download.oracle.com/javase/1.5.0/docs/guide/jni/spec/invocation.html.
Workaround
Notes
Attachment

Created date: 28 October 2011
Last Modified: 14 February 2013
Last Published: 31 October 2011
First Published date: 31 October 2011

#KnowledgeDocs
#Orbix