node-java
node-java copied to clipboard
lib/nodeJavaBridge.js hangs on Kubuntu 20.10, OpenJDK 15. Panic, can't revert!
var java = require("java");
Hangs with version 0.12.2. Reverting to 0.12.1 for now. Please patch quickly as this is hanging up everything.
node lib/nodeJavaBridge.js in the node-java folder hangs.
I can't seem to revert to 0.12.1. Help!
John
I'm on Kubuntu 20.10 and I tried removing python. Oops.
John
Reinstalling packages that were removed did not fix hanging problems.
$ node nodeJavaBridge.js
hangs
This program shows the hanging problem:
'use strict';
process.env.PATH += require('../build/jvm_dll_path.json');
var path = require('path');
var binaryPath = null;
if (!binaryPath) {
binaryPath = path.resolve(path.join(__dirname, "../build/Release/nodejavabridge_bindings.node"));
}
var bindings = require(binaryPath);
Was able to successfully revert to 0.12.1, but there are vulnerabilities.
I think I've encountered a similar phenomenon, so I'll write it here.
The node command does not exit when node-java([email protected]) is used
The procedure is as follows
- create test.js file
var java = require('java');
var javaLangSystem = java.import('java.lang.System');
javaLangSystem.out.printlnSync('Hello World');
- run
node test.js
When I use [email protected], I don't get back to the console. However I use [email protected], node exits as expected and returns to the console.
I didn't know where the bug was, I'm sorry
I just narrowed it down a bit. I could have provided similar code.
See title of mail or issue.
On Tue, Jul 27, 2021 at 10:45 AM ityuki @.***> wrote:
I think I've encountered a similar phenomenon, so I'll write it here.
The node command does not exit when @.***) is used
The procedure is as follows
- create test.js file
var java = require('java');var javaLangSystem = java.import('java.lang.System');
javaLangSystem.out.printlnSync('Hello World');
- run node test.js
When I use @., I don't get back to the console. However I use @., node exits as expected and returns to the console.
I didn't know where the bug was, I'm sorry
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/joeferner/node-java/issues/527#issuecomment-887623958, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFMJ53YP7HDEE3FHOMTPHLTZ3ICPANCNFSM5A5ABPJA .
Should I create a new issue?
After a little code change, I found the following:
After removing this line, node exits as expected and returns to the console. https://github.com/joeferner/node-java/blob/master/src/java.cpp#L83 However, it's probably not the right change.
In my sense, uvAsync_dynamicProxyJsCall may not have been released. I think I need uv_close somewhere. but I don't understand that is true,sorry...
I just want to be notified when a fix is in place.
Perhaps I should upgrade to Node.js 16?
I'm not really sure of compatibility.
John
On 7/27/21 9:07 PM, ityuki wrote:
Should I create a new issue?
After a little code change, I found the following:
After removing this line, node exits as expected and returns to the console. https://github.com/joeferner/node-java/blob/master/src/java.cpp#L83 https://github.com/joeferner/node-java/blob/master/src/java.cpp#L83 However, it's probably not the right change.
In my sense, uvAsync_dynamicProxyJsCall may not have been released. I think I need uv_close somewhere. but I don't understand that is true,sorry...
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/joeferner/node-java/issues/527#issuecomment-887953523, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFMJ5673OEALRV4BTQ4UUTTZ5Q53ANCNFSM5A5ABPJA.
@joeferner in my case it hangs on both linux/v12.18.4 and macos/v14.17.3 with latest package from npm.
To try to fix it I did
try {
if(fs.statSync && fs.statSync(path.join(__dirname, "../build/Debug/nodejavabridge_bindings.node")).isFile()) {
binaryPath = path.resolve(path.join(__dirname, "../build/Debug/nodejavabridge_bindings.node"));
console.log('****** NODE-JAVA RUNNING IN DEBUG MODE ******');
}
} catch(e) { // <----- throw an error will avoid node IO loop to hang <----------
// do nothing fs.statSync just couldn't find the file
throw new Error('file not found.');
}
but this of course do not solve the problem of this version (file not found...)