rbeckman-nextgen / test-mc3

0 stars 0 forks source link

Mirth Connect freezes when editing JavaScript (in a transformer) #4313

Open rbeckman-nextgen opened 4 years ago

rbeckman-nextgen commented 4 years ago

In the past week I've been having a lot of problems with Mirth freezing whenever I tried to edit JavaScript in it. The workaround of writing/editing JavaScript in a code editor and then - pasting it into Mirth worked to a certain extent, except when the action of pasting also caused Mirth to freeze. Monitoring Mirth's output in its Java console showed the following error that did not immediately cause the crash but seems to be related to it: Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: org.mozilla.javascript.ast.WhileLoop cannot be cast to org.mozilla.javascript.ast.DoLoop at org.fife.rsta.ac.js.ast.parser.JavaScriptAstParser.processDoNode(JavaScriptAstParser.java:412) at org.fife.rsta.ac.js.ast.parser.JavaScriptAstParser.iterateNode(JavaScriptAstParser.java:160) at org.fife.rsta.ac.js.ast.parser.JavaScriptAstParser.addCodeBlock(JavaScriptAstParser.java:103) at org.fife.rsta.ac.js.ast.parser.JavaScriptAstParser.convertAstNodeToCodeBlock(JavaScriptAstParser.java:61) at org.fife.rsta.ac.js.SourceCompletionProvider.iterateAstRoot(SourceCompletionProvider.java:423) at org.fife.rsta.ac.js.SourceCompletionProvider.getCompletionsAt(SourceCompletionProvider.java:172) at com.mirth.connect.client.ui.components.rsta.ac.js.MirthSourceCompletionProvider.getCompletionsAt(MirthSourceCompletionProvider.java:104) at org.fife.ui.autocomplete.LanguageAwareCompletionProvider.getCompletionsAt(LanguageAwareCompletionProvider.java:140) at org.fife.ui.autocomplete.LanguageAwareCompletionProvider.getToolTipText(LanguageAwareCompletionProvider.java:415) at org.fife.ui.rtextarea.RTextArea.getToolTipText(RTextArea.java:829) at org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.getToolTipTextImpl(RSyntaxTextArea.java:1760) at org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.getToolTipText(RSyntaxTextArea.java:1736) at javax.swing.ToolTipManager$insideTimerAction.actionPerformed(Unknown Source) at javax.swing.Timer.fireActionPerformed(Unknown Source) at javax.swing.Timer$DoPostEvent.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)

I was able to reproduce this behavior on a fresh VM with a similar setup (Ubuntu + OpenJDK 11 + Mirth 3.8). However, it only happened when I was connecting to the Mirth server from a Windows client. When I connected from a Linux client, there were no freezes and no error messages in the Java console. That may explain the reason why such bug may have been missed by Mirth employees, they don't use Windows workstations and the problem seems to be affecting only the Windows clients.

Upon further investigation, it seemed that this issue is happening only when using Mirth Connect Administrator Launcher application. Starting Mirth Connect from a JNLP file seems to cause no problems. Mirth Connect Administrator Launcher uses its own bundled JRE, so the client Java version is not relevant. Unfortunately, JNLP technology is being obsoleted by Java and on our network access to Mirth server's administration page is blocked as "insecure" (because of its expired certificate).

A possible solution to the problem (which I am testing right now) is to set the option "Use Legacy DH Settings" in Mirth Connect Administrator Launcher to "Yes". That stops the Java console error seen without this setting, and editing JavaScript in Mirth has not crashed on me yet. But I need more time to test that.

Imported Issue. Original Details: Jira Issue Key: MIRTH-4458 Reporter: aitougan Created: 2019-09-19T14:59:59.000-0700