Workplace Widget 5.10.23
This commit is contained in:
82
hmi-docs/cheerpj/CHEERPJ_JAVA11_NATIVE_LOADER_SUPPORT.md
Normal file
82
hmi-docs/cheerpj/CHEERPJ_JAVA11_NATIVE_LOADER_SUPPORT.md
Normal file
@@ -0,0 +1,82 @@
|
||||
# CheerpJ 5.0 / Java 11: missing JVM_LoadLibrary import for System.loadLibrary()
|
||||
|
||||
**Status:** Reproducible with a minimal application independent of customer or vendor code.
|
||||
**CheerpJ:** Core 5.0, OpenJDK 11.0.33-internal (according to Java console output).
|
||||
**Server JDK:** Java 11 on Payara/GlassFish (independent of browser JVM).
|
||||
**Java classfile:** 55 (`javac --release 11`).
|
||||
**Browser:** Edge/Chromium (as reported by customer). Additional Firefox verification not available.
|
||||
|
||||
## Minimal reproduction steps
|
||||
|
||||
The included `NativeLoaderSmoke.java` and `wwprobe.js` are vendor-independent.
|
||||
Compile the Java class for Java 11, serve the JAR with HTTP Range support, serve
|
||||
`wwprobe.js` as an ES module. Configure:
|
||||
|
||||
```js
|
||||
await cheerpjInit({
|
||||
version: 11,
|
||||
javaProperties: ["java.library.path=/app/backend/hmi/cheerpj/natives"],
|
||||
});
|
||||
await cheerpjRunMain(
|
||||
"com.widgetworkbench.cheerpj.NativeLoaderSmoke",
|
||||
"/app/backend/hmi/cheerpj/jaas-native-loader-smoke.jar",
|
||||
"wwprobe"
|
||||
);
|
||||
```
|
||||
|
||||
Native module (`wwprobe.js`):
|
||||
|
||||
```js
|
||||
export default {
|
||||
async Java_com_widgetworkbench_cheerpj_NativeLoaderSmoke_ping() {
|
||||
return 42;
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
The Java program executes `System.loadLibrary("wwprobe")` and then calls
|
||||
its `private static native int ping()` method.
|
||||
|
||||
**Actual output:**
|
||||
|
||||
```
|
||||
[NATIVE-LOADER] java.version=11.0.33-internal
|
||||
[NATIVE-LOADER] java.library.path=/app/backend/hmi/cheerpj/natives
|
||||
[NATIVE-LOADER] about to System.loadLibrary("wwprobe")
|
||||
JVM_FindLibraryEntry: JNI_OnLoad_wwprobe
|
||||
JVM_FindLibraryEntry: JNI_OnLoad_wwprobe
|
||||
Missing import: JVM_LoadLibrary
|
||||
java.lang.UnsatisfiedLinkError: no wwprobe in java.library.path
|
||||
```
|
||||
|
||||
**Expected:** `System.loadLibrary("wwprobe")` loads the JS module and the
|
||||
subsequent native call returns 42.
|
||||
|
||||
**Control test:** Using `cheerpjInit({ natives: wwprobeNativeHandlers })`
|
||||
with the same native function and **without** `System.loadLibrary()` works:
|
||||
|
||||
```
|
||||
[NATIVE-LOADER] NATIVE_CALL_RESULT=42
|
||||
[NATIVE-LOADER] PASS DIRECT_NATIVES
|
||||
Java-Exit-Code: 0
|
||||
```
|
||||
|
||||
The same `JVM_LoadLibrary` error occurs for `System.loadLibrary("jaas")`,
|
||||
which the Java 11 JDK class `com.sun.security.auth.module.UnixSystem`
|
||||
performs in its constructor.
|
||||
|
||||
## Questions for Leaning Technologies
|
||||
|
||||
1. Is `System.loadLibrary` of JavaScript ES modules supported in **CheerpJ 5.0 with OpenJDK 11**? If so, are any additional `cheerpjInit` flags/imports required?
|
||||
2. Is `Missing import: JVM_LoadLibrary` a known issue in the runtime's OpenJDK 11 native library loader? Is there a patch, fixed build, or documented workaround?
|
||||
3. Does the Java 11 `jdk.security.auth` module's `UnixSystem` work under CheerpJ without using a synthetic OS identity? What is the recommended virtual OS identity approach?
|
||||
4. Are there specific HTTP-Range or caching requirements for the CDN resource `/5.0/11/lib/modules`? An Edge session produced `ERR_CACHE_OPERATION_NOT_SUPPORTED`, but it is not proven to be causal.
|
||||
5. Can you provide a supported browser-side extension mechanism to satisfy the UnixSystem constructor without editing vendor application JARs?
|
||||
|
||||
## Scope and exclusions
|
||||
|
||||
The original MES application JARs and its authentication process are untouched.
|
||||
The test needs no customer database, internal server, iTAC classes, user credentials,
|
||||
or workstation-specific identity. The generated Java `bridge` mode is a **separate
|
||||
non-production diagnostic** of a synthetic identity helper; it is not a fix for
|
||||
`System.loadLibrary`.
|
||||
Reference in New Issue
Block a user