Java application exits when nodeRuntime.resetContext() executes #104
Replies: 2 comments 6 replies
-
Node.js has the capability of terminating the whole process (in this case, the JVM) when it encounters an unrecoverable error. I think your case is not different from running your code directly in Node.js. Here are what I would do for your reference.
Please let me know if these make sense. |
Beta Was this translation helpful? Give feedback.
-
In the application, I am giving an ability to the user of the application to write their own NodeJS script. What would be the right way to decide if nodeRuntime.await(); need to be called and when? E.g. in the case of HTTP server
|
Beta Was this translation helpful? Give feedback.
-
In my java application, I am using Javet to run a NodeJS HTTP server and some other NodeJS scripts. When I try to reset context with noderuntime.resetContext(), I notice that my entire application exits. This issue doesn't happen if I run a very basic NodeJs script without HTTP server code. At the point when resetContext is called, I also see the following error in the console logs.
I have reviewed https://www.caoccao.com/Javet/tutorial/advanced/interact_with_node_js.html before working on a solution.
Beta Was this translation helpful? Give feedback.
All reactions