This IntelliJ IDEA plugin is designed to reproduce a bug related to JCEF (Java Chromium Embedded Framework) WebView and CefMessageRouter.
The plugin creates:
- Tool Window: A "JCEF Bug" tool window on the right side with a button to open the dialog
- Menu Action: An action in the Tools menu and main toolbar to open the dialog
- Dialog with JCEF: A dialog window that contains:
- A JPanel as content holder
- A JCEFWebView (JBCefBrowser)
- A registered CefMessageRouter for JavaScript ↔ Java communication
- Test HTML page with JavaScript that sends messages to Java
- Build and Run: Build the plugin and run it in a development instance of IntelliJ IDEA
- Open Dialog: Use either:
- The "JCEF Bug" tool window button (right side panel)
- Tools menu → "Open JCEF Dialog"
- Main toolbar button
- Trigger Bug: Click OK/Cancel buttons as fast as possible to rapidly open/close dialogs
- Monitor Console: Watch for error messages and stack traces
The plugin includes automated stress testing to systematically reproduce the bug:
- Access: Tools menu → "Simple Fast Stress Test" OR tool window "Simple Fast Test" button
- Features:
- Configurable number of iterations (default: 1000)
- Configurable delay between iterations (default: 10ms)
- Simple open → wait → close cycle
- Stops immediately on any error
- Use Case: Automated rapid dialog cycling to trigger race conditions
- Access: Tools menu → "Start Aggressive JCEF Test"
- Features:
- Multiple concurrent testing strategies:
- Rapid sequential: Very fast open/close cycles (5ms delay)
- Overlapping lifecycles: Random timing between open/close (10-60ms)
- Immediate close: Manual close immediately after show (race condition)
- Multi-threaded execution to trigger race conditions
- Real-time monitoring of active dialogs and errors
- Auto-stops after 10 errors or 5 minutes
- Multiple concurrent testing strategies:
- Use Case: Maximum pressure testing with concurrent dialog lifecycles
- JCEFBugAction: Action class that opens the dialog
- JCEFBugDialog: Modal DialogWrapper containing the JCEF WebView with manual OK/Cancel buttons
- JCEFBugSimpleStressTest: Simple automated stress testing with configurable parameters
- JCEFBugAggressiveTest: Multi-threaded concurrent testing for maximum race condition pressure
- JCEFBugTargetedTest: Isolates the CefMessageRouter creation race condition
- JCEFBugToolWindow: Tool window factory and content
- CefMessageRouter: Configured with test communication handlers
The dialog creates:
- JBCefBrowser instance
- CefMessageRouter with "jcefQuery" and "jcefQueryCancel"
- Message handler that echoes received messages
- Test HTML with JavaScript that sends messages via
window.jcefQuery()
The HTML page includes:
- Buttons to send test messages
- JavaScript that communicates with Java via CefMessageRouter
- Output area showing communication results
- Automatic message sending on page load
# Build the plugin
./gradlew buildPlugin
# Run in development IDE
./gradlew runIdeWhen opening and closing the dialog rapidly multiple times, the CefMessageRouter and JCEF WebView disposal/cleanup should eventually trigger the bug you're investigating. The combination of:
- Quick dialog open/close cycles
- Active JavaScript ↔ Java communication
- CefMessageRouter cleanup during disposal
Should create the conditions needed to reproduce the issue.
Bug: java.lang.NullPointerException: Cannot read field "objId" because "robj" is null
Location: com.jetbrains.cef.remote.router.RemoteMessageRouterImpl.create(RemoteMessageRouterImpl.java:38)
Root Cause: Race condition in JCEF's remote message router initialization where the remote object (robj) is accessed before being properly initialized.
Trigger Conditions:
- Rapid CefMessageRouter creation/disposal cycles
- Multiple concurrent JCEF browser instances
- Remote CEF server connection timing issues
Reproduction Success: ✅ Confirmed with the stress testing tools in this plugin.
All available actions in Tools menu:
- Open JCEF Bug Dialog - Basic manual dialog for rapid clicking
- Simple Fast Stress Test - Automated stress testing with configurable parameters
- Start Aggressive JCEF Test - Multi-threaded concurrent testing (most effective)
- Manual Test Dialog - Single dialog for manual verification
- Targeted RemoteMessageRouter Race Test - Isolates CefMessageRouter creation race
- Test Dialog Close Mechanism - Tests basic dialog closing functionality