class not found by FindClass() - jvm

I used JNI_CreateJavaVM() to create JVM with:
-Djava.class.path=/usr/src/buck/build/bootstrapper/bootstrapper.jar:/usr/lib/jvm/java-8-openjdk-amd64//bin:/usr/src/hbase/bin/../conf:/usr/lib/jvm/java-8-openjdk-amd64//lib/tools.jar:...
I then used the following:
testingUtilClass = (*env).FindClass("org/apache/hadoop/hbase/HBaseTestingUtility");
Though /usr/src/hbase/hbase-server/target/hbase-server-2.0.0-SNAPSHOT-tests.jar was among the class path above, testingUtilClass was null.
I verified:
jar tvf /usr/src/hbase/hbase-server/target/hbase-server-2.0.0-SNAPSHOT-tests.jar | grep HBaseTestingUtility
104512 Sat Feb 11 01:53:58 UTC 2017 org/apache/hadoop/hbase/HBaseTestingUtility.class
What could be the cause ?
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-0ubuntu4~16.04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
Thanks

Related

How to run Ignite with defined JVM heap

Currently Ignite is taking the default installed OpenJDK 11 JVM heap size. Now, I want to define the JVM initial and max heap size for Ignite Instance. Where exactly I need to define so that it will take the defined JVM heap config to run.
You can use -Xms, -Xmx to set JVM memory parameters.
Here is more information: https://apacheignite.readme.io/docs/jvm-and-system-tuning
and: https://apacheignite.readme.io/docs/preparing-for-production
JDK 11 specific: https://docs.oracle.com/cd/E15523_01/web.1111/e13814/jvm_tuning.htm#PERFM160
In the Ignite logs you could see how much memory was allocated along with other parameters: look for these lines:
[IgniteKernal] Language runtime: Java Platform API Specification ver. 11
[IgniteKernal] VM information: Java(TM) SE Runtime Environment 11.0.4+10-LTS Oracle
Corporation Java HotSpot(TM) 64-Bit Server VM 11.0.4+10-LTS
[IgniteKernal] VM total memory: 1.0GB
[IgniteKernal] VM arguments: [-Xms1g, -Xmx1g, ...

memory leak in weblogic rmi driver

We are having a memory leak issue after we started to use our existing Weblogic Datasource from our standalone apps. Standalone apps and WL Datasource does not lay in the same server. We are retrieving datasource with JNDI via t3 protocol.
We have used the approach down here.
https://docs.oracle.com/cd/E13222_01/wls/docs51/classdocs/API_jndi.html
87% of heap is allocated with weblogic/jdbc/rmi/internal/StructImpl_oracle_sql_STRUCT objects. This objects are in package RMI(Remote Method Invocation) and the problem itself started to appear after this remote usage. Since these two things happened at the same time we are suspicious that if we have done something wrong in the process of remote Datasource usage.
Everything works fine but we are restarting the nodes every 2-3 days and started to became a burden to us.
What can be the causes of this memory leak? Should we change anything in datasource properties or do we need to pass extra JVM parameters?
Here is a snapshot of our heap
Here is the weblogic properties.
Weblogic major version 10.3.6.0
Patch level: 10.3.6.0.181016 (October 2018 PSU - GENM)
Java version: Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode) - 1.6.0_45
MEM_ARGS="-Xms4096m -Xmx6144m -Xmn1024m -XX:SurvivorRatio=8 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:PermSize=256m -XX:MaxPermSi
ze=512m -verbosegc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -Xloggc:${LOGDIR}/GC_logs.${SERVER_NAME} -XX:+UseGCLogFileRotation -XX
:+PrintGCDateStamps -XX:NumberOfGCLogFiles=100 -XX:GCLogFileSize=512M"
--- EXTRA JAVA OPTIONS
-DASA_MARK=ASA_VERSION_2016.02.17"
-Dweblogic.management.server=${ADMIN_URL}"
-DHostName_WLSName=${value_hostname}-${WLS_NAME}"
-Dweblogic.system.BootIdentityFile=${DOMAIN_HOME}/boot.properties"
-Dweblogic.rjvm.enableprotocolswitch=true"
-Djava.net.preferIPv4Stack=true"
Here is our standalone app properties
[wlsadmin#machine1 cfg]$ /usr/java/jdk1.6.0_26/bin/java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
CLASSPATH=$CLASSPATH:$HOME/lib/wlfullclient.jar
[wlsadmin#machine1 META-INF]$ more MANIFEST.MF
Manifest-Version: 1.0
Implementation-Vendor: Oracle Corp.
Implementation-Title: JDK 1.6 Client jar for WebLogic Server 10.3 Tue
Nov 15 08:52:36 PST 2011 1441050
Implementation-Version: 10.3.6.0
CLASSPATH=$CLASSPATH:$HOME/lib/ojdbc5.jar
[wlsadmin#machine1 META-INF]$ more MANIFEST.MF
Manifest-Version: 1.0
Specification-Title: "Oracle Globalization Development Kit"
Class-Path: orai18n-mapping.jar orai18n-utility.jar orai18n-collation.
jar orai18n-translation.jar orai18n-net.jar orai18n-servlet.jar orai1
8n-lcsd.jar orai18n-tools.jar gdk_custom.jar
Created-By: 1.5.0_07 (Sun Microsystems Inc.)
Main-Class: oracle.i18n.util.GDKOracleMetaData
Implementation-Title: "orai18n.jar archives"
Specification-Vendor: "Oracle Corporation"
Specification-Version: "Oracle Globalization Development Kit - 11.2.0.
1.0 - Production, Build : 11"
Implementation-Version: "Oracle Globalization Development Kit -
-Xms64m -Xmx256m
I am not able to guess what changes you can make in the relevant code, but based on the memory leak description - this is related to use of non thread safe hashmap.
It may help to try using ConcurrentHashMap.
Please check these links for more details:
https://support.oracle.com/knowledge/Middleware/1966075_1.html
https://javaeesupportpatterns.blogspot.com/2011/11/hashmap-thread-safe-problem-case-study.html

SIGSEGV - Fatal Error in JavaFX Application - libjvm.so [duplicate]

#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007ff17a60c678, pid=4219, tid=140673779791616
#
# JRE version: Java(TM) SE Runtime Environment (8.0-b124) (build 1.8.0-ea-b124)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.0-b66 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x665678] jni_invoke_nonstatic(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*)+0x38
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /media/data/K's World/javaFX/ChatApp/hs_err_pid4219.log
Compiled method (c1) 16675 988 3 java.util.concurrent.atomic.AtomicBoolean::set (14 bytes)
total in heap [0x00007ff16535ef50,0x00007ff16535f2a0] = 848
relocation [0x00007ff16535f070,0x00007ff16535f0a0] = 48
main code [0x00007ff16535f0a0,0x00007ff16535f1c0] = 288
stub code [0x00007ff16535f1c0,0x00007ff16535f250] = 144
metadata [0x00007ff16535f250,0x00007ff16535f258] = 8
scopes data [0x00007ff16535f258,0x00007ff16535f268] = 16
scopes pcs [0x00007ff16535f268,0x00007ff16535f298] = 48
dependencies [0x00007ff16535f298,0x00007ff16535f2a0] = 8
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
#
I am writing chat App in javaFx..and I am using eclipse IDE..
My Application is running well but I don't know why suddenly application has been stopped.
It sounds like you're running JavaFX with Java 8 on Linux, and you've run into this bug:
https://bugs.openjdk.java.net/browse/JDK-8141687
App crashes while starting Main.class in JavaFx
ava version "1.8.0_60" Java(TM) SE Runtime Environment (build
1.8.0_60-b27) Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
ADDITIONAL OS VERSION INFORMATION : Mint17.2 Cinnamon 64Bit
SUGGESTION: Try a different version of Java/JavaFX.
Run sudo update-alternatives --config java to see what alternatives are already present on your system. I would downgrade to Java 1.7 if possible.
https://askubuntu.com/questions/272187/setting-jdk-7-as-default
If there are no suitable candidates, use apt-get install openjdk-7-jdk:
https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get
I had the same issue (except that it was java-8-oracle build 101) and found out why it was happening:
I have a login screen that appears before my main application and that screen gets closed after the login occurs and, apparently, closing it (or even hiding it) and showing a new window makes it crash.

Aptana closes unexpectedly

I just installed Aptana Studio 3.4.2 on a fresh install of Linux Mint 16 with Oracle java. The program closes unexpectedly. So far I've only used it with the Python perspective active. It seems to happen more often when I'm editing an html file. I used it for 3 hours one day before it crashed; other times only 10 minutes.
The log file has a recurring error that may be related but I can't find any info on it:
!MESSAGE Invalid preference page path: XML Syntax.
Does anyone know what is causing this?
Java Version:
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
Aptana Diagnostic:
Host OS: Linux
OS Version: 3.11.0-12-generic
OS Arch: x86_64
JRE Version: 1.7.0_45
JRE Vendor: Oracle Corporation
JRE Home: /opt/java/jdk1.7.0_45/jre
Aptana Studio 3 Version: 3.4.2.201308081805
Install Directory: file:/opt/Aptana_Studio_3/
Workspace Directory: file:/home/jeff/workspace/
VM Arguments: -Xms40m
-Xmx512m
-Declipse.p2.unsignedPolicy=allow
-Declipse.log.size.max=10000
-Declipse.log.backup.max=5
-Djava.awt.headless=true
-XX:MaxPermSize=256m
-jar
/opt/Aptana_Studio_3//plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
Language: en_US
Node.JS Version: Not installed
NPM Path: Not installed
ENV:
MDMSESSION=default
GNOME_KEYRING_CONTROL=/run/user/1000/keyring-ka4Jsn
SHLVL=1
SSH_AGENT_PID=1662
TEXTDOMAINDIR=/usr/share/locale/
XFILESEARCHPATH=/usr/dt/app-defaults/%L/Dt
GDM_XSERVER_LOCATION=local
SESSION_MANAGER=local/jeff-main:#/tmp/.ICE-unix/1585,unix/jeff-main:/tmp/.ICE-unix/1585
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
CLUTTER_DISABLE_XINPUT=1
GDMSESSION=default
XDG_SESSION_COOKIE=812a644561ed637b3aa6135652bf871c-1389232561.233987-1413464634
XDG_DATA_DIRS=/usr/share/default:/usr/share/gnome:/usr/local/share/:/usr/share/:/usr/share/mdm/
MANDATORY_PATH=/usr/share/gconf/default.mandatory.path
PWD=/home/jeff
GIO_LAUNCHED_DESKTOP_FILE=/home/jeff/Desktop/AptanaStudio3.desktop
MDM_XSERVER_LOCATION=local
LOGNAME=jeff
GPG_AGENT_INFO=/run/user/1000/keyring-ka4Jsn/gpg:0:1
GIO_LAUNCHED_DESKTOP_FILE_PID=3387
SSH_AUTH_SOCK=/run/user/1000/keyring-ka4Jsn/ssh
NLSPATH=/usr/dt/lib/nls/msg/%L/%N.cat
TEXTDOMAIN=im-config
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-9GHbJcIE3A,guid=4d478335c530a3bf45ec18fb52ce01b1
SHELL=/bin/bash
GNOME_KEYRING_PID=1509
XDG_CURRENT_DESKTOP=GNOME
XDG_CONFIG_DIRS=/etc/xdg/xdg-default:/etc/xdg
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
DESKTOP_SESSION=default
APTANA_VERSION=3.4.2.1368863613
DISPLAY=:0.0
USER=jeff
HOME=/home/jeff
XAUTHORITY=/home/jeff/.Xauthority
XDG_SEAT=seat0
WINDOWPATH=8
XDG_SESSION_ID=c1
DEFAULTS_PATH=/usr/share/gconf/default.default.path
MDM_LANG=en_US.UTF-8
USERNAME=jeff
XDG_VTNR=8
XDG_RUNTIME_DIR=/run/user/1000
LANG=en_US.UTF-8
I Had the same problem with PHP. I found out that the program terminate when I hover my mouse over an object. So far so good after disabling the hover.
To disable: Window -> Preferences -> Content Assist -> Show information on hover: off
Try add
-Dorg.eclipse.swt.browser.DefaultType=mozilla
in AptanaStudio3.ini
Eclipse continue crashing
open AptanaStudio3.ini and append this line to end of file:
-Dorg.eclipse.swt.browser.DefaultType=mozilla
Try install Xterm and open again.

Failed to start Glassfish after increasing heap size

I want to increase the heap size of my Glassfish. For that, I know that I can go up to 4GB:
java -Xmx4000M -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)
I tried to set in domain.xml file the -Xmx to 2GB:
<jvm-options>-Xmx2000m</jvm-options>
But I am getting the following error:
asadmin> start-domain
Waiting for ... to start .Error starting domain ...
The server exited prematurely with exit code 1.
Before it died, it produced the following output:
Error occurred during initialization of VM
The size of the object heap + VM data exceeds the maximum representable size
launchctl bsexec failed: Inappropriate ioctl for device
Launching the command with -v option gives this:
12 oct. 2011 11:46:34 com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: JVM invocation command line:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java
-XX:+UnlockDiagnosticVMOptions
-XX:MaxPermSize=512m
-XX:NewRatio=2
-XX:+CMSClassUnloadingEnabled
-Xmx2000m
-Xms1000m
...
12 oct. 2011 11:46:35 com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: Successfully launched in 45 msec.
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
Command start-domain failed.
I found the problem. For some reasons which I do not understand, the "-d32" argument was passed in the command, asking to start in 32 bits mode. When adding
<jvm-options>-d64</jvm-options>
to the domain.xml file, glassfish starts. Please note that this option is not present by default in the file.
you must be using a different Java install when doing the "-version" and from within GlassFish. I can reproduce the same error with the default "java" in Mac OS' path but not when using an absolute path :
% /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Xmx2300m -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-383, mixed mode)
% java -Xmx2300m -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
Could it be that you don't have enough disk space on your system? Reserving 4GB of RAM may require MAC OS to expand swap space, and you may not have the disk space to do this. Unfortunately, this has burned me before :-/