eclipsesource / eclipsesource/J2V8

tomcat hotreload fails to load J2V8 JNI

Open
#145 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.6k
Forks
387
PR merge metrics
No merged PRs in 30d

Description

I'm using J2V8 on a Tomcat application. It's failing to load the J2V8 when the Tomcat doing a reload (example: changing web.xml). I have used the debugger to trace down the source of the exception. It happends in LibraryLoader.java#L111 where the FileOutputStream is unable to open access to the file because the file is already used in the JVM of Tomcat.
After i change the LibraryLoader.java to detect first if the JNI library already loaded (by calling System.loadLibrary and catch the Exception "already loaded") then skip the extract method. Fails too because when it tries to call V8._createIsolate it throws a UnstatisfiedLinkError.
I cannot use the J2V8 in the Tomcat lib folder because we deploy the application with the WAR file.
I hope you have an idea how i solve the problems for Tomcat applications.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.