Skip to content

Fix NoSuchMethodError in Hop Web when changing GUI options#6546

Merged
hansva merged 1 commit intoapache:mainfrom
chuheridangwua:fix/hop-web-dark-theme-error
Feb 11, 2026
Merged

Fix NoSuchMethodError in Hop Web when changing GUI options#6546
hansva merged 1 commit intoapache:mainfrom
chuheridangwua:fix/hop-web-dark-theme-error

Conversation

@chuheridangwua
Copy link
Contributor

Problem

When using Hop Web (RAP-based web interface) and changing locale or other GUI options, the application crashes with HTTP 500 error:

java.lang.NoSuchMethodError: 'boolean org.eclipse.swt.widgets.Display.isSystemDarkTheme()'
at org.apache.hop.ui.hopgui.perspective.configuration.tabs.ConfigGuiOptionsTab.saveValues(ConfigGuiOptionsTab.java:945)

Root Cause

Display.isSystemDarkTheme() is a desktop SWT API that is not available in Eclipse RAP (Web environment). The ConfigGuiOptionsTab class calls this method without checking if running in
web mode.

Solution

Added EnvironmentUtils.getInstance().isWeb() check before calling Display.isSystemDarkTheme():

  • In web environment or Windows: use the stored/selected dark mode preference
  • In desktop non-Windows (macOS/Linux): detect system theme as before

Changes

  • ui/src/main/java/.../ConfigGuiOptionsTab.java
    • reloadValues() method
    • saveValues() method

Testing

  • Tested on Hop Web 2.18.0-SNAPSHOT (Docker container with Tomcat 10)
  • Verified locale can be changed to Chinese without errors
  • Dark mode toggle works correctly in both Web and Desktop environments

Display.isSystemDarkTheme() method is not available in Eclipse RAP (Web environment).
Calling this method causes java.lang.NoSuchMethodError exception when users
try to change locale or other GUI options in Hop Web.

Changes:
- Add EnvironmentUtils.getInstance().isWeb() check in ConfigGuiOptionsTab.java
- In reloadValues(): use stored dark mode preference in Web environment
- In saveValues(): use checkbox selection value in Web environment

This fix allows Hop Web users to change locale and GUI settings without errors.
@hansva hansva merged commit 4e026e5 into apache:main Feb 11, 2026
2 checks passed
@hansva
Copy link
Contributor

hansva commented Feb 11, 2026

Thanks @chuheridangwua !

@chuheridangwua chuheridangwua deleted the fix/hop-web-dark-theme-error branch February 12, 2026 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants