joeferner / node-java

Bridge API to connect with existing Java APIs.
MIT License
1.87k stars 280 forks source link

crash on java.ensureJvm if multiple test files trying to call some java functions. #498

Open poojachoudhary13 opened 4 years ago

poojachoudhary13 commented 4 years ago

sample code : var java = require("java"); java.classpath.push('./src/utils/abc/crypto-service.jar'); var SecuredAESUsage = java.import('com.abc.crypto.SecuredAESUsage'); var aes = new SecuredAESUsage(); let encPayload = aes.aesEncryptSync(payLoadStr);

Also Tried :

console.log("Is` JVM created new :" + java.isJvmCreated()) java.ensureJvm(function (error: any) { console.log('error', error); })

I am trying to call the above code from multiple files for first file it works but in second file i get below error

`A fatal error has been detected by the Java Runtime Environment:

SIGSEGV (0xb) at pc=0x0000000107acfc92, pid=93833, tid=0x0000000000000307 JRE version: Java(TM) SE Runtime Environment (8.0_201-b09) (build 1.8.0_201-b09) Java VM: Java HotSpot(TM) 64-Bit Server VM (25.201-b09 mixed mode bsd-amd64 compressed oops) Problematic frame: C [nodejavabridge_bindings.node+0x1ac92] Z20getSystemClassLoaderP7JNIEnv+0x12

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: /Users/pc/abc/hs_err_pid93833.log

If you would like to submit a bug report, please visit: http://bugreport.java.com/bugreport/crash.jsp The crash happened outside the Java Virtual Machine in native code. See problematic frame for where to report the bug.

Abort trap: 6 `

crrobinson14 commented 3 years ago

@poojachoudhary13 Did you ever find a solution for this?

Tomas2D commented 2 years ago

I am having same issue, any update on this? @crrobinson14 @poojachoudhary13