Load Workplace client JARs from current MES JNLP only
This commit is contained in:
@@ -1,100 +1,60 @@
|
||||
# WidgetWorkbench / Workplace – GlassFish candidate, 2026-11-22
|
||||
# Workplace / GlassFish – remote-only correction, 2026-11-23
|
||||
|
||||
## Artifact and scope
|
||||
## Correction and authority
|
||||
|
||||
`backend-1.war` is built for Java EE 8 (`javax.*`), Java 11 bytecode and context root `/backend`.
|
||||
Use the existing compatible GlassFish/Payara environment (not a Jakarta-only GlassFish 6/7 installation).
|
||||
Keep the existing `dsCustNJTA`, MES datasource, IMSAPI configuration and role assignments.
|
||||
No server configuration or deployment has been changed by this build.
|
||||
The previous build packaged a fixed ZIP snapshot. This can mismatch the running MES backend.
|
||||
The user confirmed the login works and requires the JARs from the current MES Workplace.jnlp.
|
||||
This build therefore ALWAYS fetches the configured JNLP from the authenticated IMSAPI target
|
||||
under `/mes/webstart/clients/`, and the approved manufacturer JARs from that MES server.
|
||||
There is no ZIP/bundled fallback, including on TLS, network or HTTP failures.
|
||||
The old `hmi.workplace.source=bundled` setting is no longer consulted.
|
||||
`Workplace.zip` is reference material only, not a build input or runtime source.
|
||||
|
||||
The 129 platform-independent manufacturer JARs from `Workplace.zip` are included byte-for-byte
|
||||
under `WEB-INF/classes/hmi/workplace-jars/`. They are NOT server libraries in `WEB-INF/lib`
|
||||
and cannot be downloaded directly through a public static URL. The existing authenticated,
|
||||
role-checked endpoint serves them with HTTP Range support. JAR hashes were checked in the final WAR.
|
||||
Each manifest request (widget start/restart) fetches a fresh upstream manifest and invalidates
|
||||
server-side JAR cache generations, even if all filenames stayed the same. Browser HTTP responses
|
||||
for manufacturer JARs use `private, no-store, no-transform`. The server still caches downloaded
|
||||
bytes within a generation to serve CheerpJ's many Range requests efficiently.
|
||||
Restart/reload Workplace after a backend upgrade; already-loaded Java classes cannot be hot-swapped.
|
||||
Avoid upgrading the MES during a running client session. No atomic upstream release snapshot is implied.
|
||||
|
||||
The original manifest parser currently accepts flat JAR filenames within the configured MES
|
||||
clients directory. Unsupported JNLP structures/paths fail explicitly, never substitute ZIP files.
|
||||
Platform-specific JNI/RXTX dependencies remain unsupported by the browser VM.
|
||||
|
||||
## Deployment
|
||||
|
||||
1. Back up the existing deployment and retain its server settings.
|
||||
2. Deploy `backend-1.war` using the GlassFish console, application context root `/backend`.
|
||||
When using asadmin, select your existing domain/instance explicitly; do not create new datasources.
|
||||
3. Sign in to `/backend/hmi/` using the existing IMSAPI login. The user requires `hmi-workplace`
|
||||
or `hmi-admin`; widget editing additionally requires the existing designer/script-editor roles.
|
||||
4. Add/use `ui.cheerpj-workplace` in the normal runtime page. The browser uses Java 11 / CheerpJ 5.0.
|
||||
5. For a full-window diagnostic after login, open:
|
||||
`/backend/hmi/cheerpj-runner.html?standalone=workplace&windows=diagnose`
|
||||
6. Verify login, window rendering and your read-only test workflow before any production bookings.
|
||||
Deploy `release/backend-1.war` on the existing Java EE 8 (`javax.*`), Java-11-compatible
|
||||
GlassFish/Payara instance with context `/backend`. This WAR is not for a Jakarta-only GlassFish 6/7.
|
||||
Preserve the existing datasources, IMSAPI target and role configuration. No server configuration
|
||||
or live deployment was changed while creating this artifact.
|
||||
|
||||
## Resource source
|
||||
After redeployment, close the old Workplace tab/iframe and reopen the widget (or hard-reload).
|
||||
Existing role requirements remain: `hmi-workplace` or `hmi-admin` for runtime/JAR downloads.
|
||||
The Browser JAAS fix remains: `os.name=CheerpJ Browser` and `user.name=cheerpj-client` passed
|
||||
via CheerpJ initialization. This does not replace MES authentication. No manufacturer bytecode
|
||||
or signatures are altered; the old unsigned SysParameter override remains disabled by default.
|
||||
Window diagnostics default to OFF; explicit diagnostics remain available for troubleshooting.
|
||||
|
||||
Default: bundled archive and bundled `Workplace.jnlp`. This is a pinned client version, not an automatic
|
||||
update from the MES. Ensure this version matches the deployed MES.
|
||||
For remote manifests/JARs, set `-Dhmi.workplace.source=remote` in the chosen GlassFish domain,
|
||||
after inspecting existing JVM options. Remote mode still validates TLS and requires a valid CA chain.
|
||||
Other configured JNLP filenames require remote mode. Bundled mode does not silently mix versions.
|
||||
The application and MES must be same-origin or MES must allow the Workbench origin via CORS.
|
||||
GlassFish must trust the TLS chain of the MES host to download the remote manifest/JARs.
|
||||
The browser separately needs trust and connectivity to all MES-discovered service endpoints.
|
||||
No TLS bypass or credential forwarding was added. Upstream failure is an error, not an archive fallback.
|
||||
|
||||
## Browser network requirements – NOT solved by local JAR packaging
|
||||
Open `/backend/hmi/` and use the existing Workplace widget. For a full window after HMI login:
|
||||
`/backend/hmi/cheerpj-runner.html?standalone=workplace`
|
||||
CheerpJ 5.0 is loaded from its CDN; an appropriate license is required for business use.
|
||||
|
||||
Workplace directly calls MES ARTES services from the browser. Deploy Workbench on the SAME HTTPS
|
||||
origin (scheme, host AND port) as MES, or configure the MES server to allow the actual Workbench
|
||||
origin. The isolated localhost browser test observed CORS failures for `/mes/artes/settings`,
|
||||
`/workbench/artes/settings` and `/help/artes/settings` and service discovery calls.
|
||||
Cluster discovery can also return internal addresses (including 192.168.20.106 in the supplied
|
||||
partner environment). Every returned endpoint must be reachable and have browser-trusted TLS;
|
||||
a local WAR cannot fix the remote cluster topology. No TLS or browser security checks are disabled.
|
||||
## Verification and limits
|
||||
|
||||
The shell HTTPS request to the partner JNLP failed certificate validation; Chromium could reach
|
||||
initial cluster discovery. Browser and GlassFish trust stores need independent verification.
|
||||
- Vue typecheck/Vite and Maven package: passed.
|
||||
- New regression: same remote JAR filename changed from v1 to v2; after invalidation v2 is served.
|
||||
- Missing remote server after invalidation raises an error; no old bytes used as fallback.
|
||||
- No packaged manufacturer JAR bundle; unsafe XML rejected.
|
||||
- Existing HTTP Range/cache, manifest and CheerpJ suites passed.
|
||||
- The user reports the login works with the previous identity fix, retained here.
|
||||
- No authenticated MES workflow, remote version compatibility or Windows-GlassFish deployment
|
||||
has been end-to-end tested with this new build. The previous screenshot is NOT a new-build test.
|
||||
|
||||
CheerpJ runtime is loaded from `https://cjrtnc.leaningtech.com/5.0/loader.js` (HTTP 200 verified).
|
||||
Business use requires an appropriate CheerpJ license; no license was purchased or supplied.
|
||||
Native RXTX/serial drivers are not supported as desktop JNI in a browser.
|
||||
|
||||
## JAAS / signed classes
|
||||
|
||||
The original build enabled an unsigned `SysParameter` replacement before signed vendor JARs.
|
||||
The archive confirms other signed classes share its package. The replacement is now OFF by default.
|
||||
`sysparam=on` is an explicit diagnostic opt-in only; it is not a general production fix for signed
|
||||
packages. The original JAAS native bridge remains. No vendor signatures or class bytes were changed.
|
||||
|
||||
The same-origin browser test reproduced `Missing import: JVM_LoadLibrary` with native identity.
|
||||
The runner now supplies `os.name=CheerpJ Browser` and `user.name=cheerpj-client` via
|
||||
`cheerpjInit.javaProperties` and in the library context before vendor main(). Runtime-only
|
||||
System.setProperty calls did NOT fix the separate application launch in the browser test. Bytecode inspection of the supplied original SysParameter confirms
|
||||
that unrecognized OS names use its existing user.name fallback instead of loading desktop JAAS.
|
||||
This is a synthetic local identity, NOT an authenticated MES user or OS SSO. Regular MES login
|
||||
is still required. `identity=native` restores the old behavior for diagnosis. OS-specific integrations
|
||||
need separate testing because the application sees a non-desktop operating system.
|
||||
|
||||
## Rebuild and automated validation
|
||||
|
||||
From the project root:
|
||||
|
||||
```sh
|
||||
bash build-hmi.sh
|
||||
npm run test:cheerpj --prefix hmi-frontend
|
||||
bash hmi-scripts/test-workplace-range.sh
|
||||
bash hmi-scripts/test-workplace-cluster.sh
|
||||
```
|
||||
|
||||
Build prerequisites: Python 3, Node/npm, Maven, JDK 11+ (`javac --release 11`).
|
||||
`prepare-workplace.py` validates and stages the supplied archive; do not put `.workplace-bundle`
|
||||
in source control. Build scripts work even when archive extraction removed executable bits.
|
||||
JaCoCo is updated for the installed JDK 25; vendor JAR resources are excluded from application
|
||||
coverage analysis (they contain duplicate vendor API classes). Application checks remain enabled.
|
||||
|
||||
Verified: Vue typecheck/Vite build, Maven package, 2 new bundle tests, 18 Range/cache checks,
|
||||
existing CheerpJ contract suites, all 129 final WAR JAR hashes. No authenticated MES login,
|
||||
booking, full GlassFish deployment or database integration test has been performed.
|
||||
|
||||
## Observed browser result
|
||||
|
||||
Chromium + CheerpJ 5.0 + Java 11 rendered the Workplace main window AND the real MES login
|
||||
form (user name, password, client 01, Login/Change password/Cancel) after initialization properties
|
||||
were applied. Screenshot: `workplace-login.png`. The `JVM_LoadLibrary` startup blocker did not
|
||||
recur in this run. No credentials were entered and no authenticated workflow was exercised.
|
||||
|
||||
Test setup: Playwright locally fulfilled ONLY `/backend/**` from the built WAR/resources while
|
||||
the page used the partner server origin; actual MES requests used the partner server. This models
|
||||
same-origin deployment, but it is NOT proof of a GlassFish deployment or of HMI authentication.
|
||||
The localhost-origin test separately exposed the expected CORS failures. The renderer test does
|
||||
not certify all native desktop functions, resize behavior, printing or every Workplace module.
|
||||
Rebuild from the project root with `bash build-hmi.sh` (Linux) or `./build-hmi.ps1` (Windows).
|
||||
Neither build requires Workplace.zip. This correction concerns client library selection;
|
||||
it does not change classes or deployments inside the MES server.
|
||||
|
||||
Reference in New Issue
Block a user