如何解决 JMeter 中的更新 GUI 错误
How to resolve updating GUI error in JMeter
我在 JMeter 中遇到 'problem updating GUI' 错误。我正在使用网络驱动程序示例,当我插入 java 脚本代码时。发生此错误。
JMeter 版本 - 3.3
我也尝试过使用较低版本,例如:2.11、3.0、3.2 等,但没有找到解决方案。
当 JMeter 下的日志文件中出现此错误时,我可以看到以下异常:-
////////////////////////////////////////// /////////////////////////////////
jmeter.gui.action.ActionRouter: performAction(logger_panel_enable_disable) updateCurrentGui() onjava.awt.event.ActionEvent[ACTION_PERFORMED,cmd=logger_panel_enable_disable,when=0,modifiers=] on javax.swing.JButton[,1281,8,22x22,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@15a010e8,flags=16777504,maximumSize=,minimumSize=,preferredSize=,defaultIcon=jar:file:/C:/Users/gaurav.sharma/Downloads/apache-jmeter-2.11/apache-jmeter-2.11/lib/ext/ApacheJMeter_core.jar!/org/apache/jmeter/images/warning.png,disabledIcon=,disabledSelectedIcon=,margin=java.awt.Insets[top=0,left=0,bottom=0,right=0],paintBorder=false,paintFocus=true,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=,defaultCapable=true] caused java.lang.ClassCastException: java.desktop/javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper cannot be cast to java.desktop/javax.swing.text.AbstractDocument$DefaultDocumentEvent
////////////////////////////////////////// /////////////////////////////////
TL;DR 在最新的 JMeter 中标记为已修复的错误
此错误发生在 Java 9。在多个项目中报告为 netbeans:
This bug i due to a change in Java 9 where the edit of the argument (a
DefaultDocumentEvent) is first wrapped in a DefaultDocumentEventUndoableWrapper which hides the line number and other important stuff (I can't understand why!!), before
public void undoableEditHappened(UndoableEditEvent e)
is invoked.
This makes this cast break:
AbstractDocument.DefaultDocumentEvent event =
(AbstractDocument.DefaultDocumentEvent)e.getEdit();
The problem is that this cast is widely used in all kinds of code - originating from this post from 2008: https://tips4java.wordpress.com/2008/10/27/compound-undo-manager/
Here is a possible fix:
https://github.com/nordfalk/jsyntaxpane/commit/5fc75594f8bc4df6e8f7096d4a440490b768fd46#diff-b3f8826824f551219879f1c798618c12R67
JMeter暂不支持JAVA9,下个JMeter版本应该会支持,大家可以在Bug 61529.
中帮助关注这方面的进展
我在 JMeter 中遇到 'problem updating GUI' 错误。我正在使用网络驱动程序示例,当我插入 java 脚本代码时。发生此错误。 JMeter 版本 - 3.3 我也尝试过使用较低版本,例如:2.11、3.0、3.2 等,但没有找到解决方案。
当 JMeter 下的日志文件中出现此错误时,我可以看到以下异常:-
////////////////////////////////////////// /////////////////////////////////
jmeter.gui.action.ActionRouter: performAction(logger_panel_enable_disable) updateCurrentGui() onjava.awt.event.ActionEvent[ACTION_PERFORMED,cmd=logger_panel_enable_disable,when=0,modifiers=] on javax.swing.JButton[,1281,8,22x22,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@15a010e8,flags=16777504,maximumSize=,minimumSize=,preferredSize=,defaultIcon=jar:file:/C:/Users/gaurav.sharma/Downloads/apache-jmeter-2.11/apache-jmeter-2.11/lib/ext/ApacheJMeter_core.jar!/org/apache/jmeter/images/warning.png,disabledIcon=,disabledSelectedIcon=,margin=java.awt.Insets[top=0,left=0,bottom=0,right=0],paintBorder=false,paintFocus=true,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=,defaultCapable=true] caused java.lang.ClassCastException: java.desktop/javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper cannot be cast to java.desktop/javax.swing.text.AbstractDocument$DefaultDocumentEvent
////////////////////////////////////////// /////////////////////////////////
TL;DR 在最新的 JMeter 中标记为已修复的错误
此错误发生在 Java 9。在多个项目中报告为 netbeans:
This bug i due to a change in Java 9 where the edit of the argument (a DefaultDocumentEvent) is first wrapped in a DefaultDocumentEventUndoableWrapper which hides the line number and other important stuff (I can't understand why!!), before
public void undoableEditHappened(UndoableEditEvent e)
is invoked.
This makes this cast break: AbstractDocument.DefaultDocumentEvent event = (AbstractDocument.DefaultDocumentEvent)e.getEdit();
The problem is that this cast is widely used in all kinds of code - originating from this post from 2008: https://tips4java.wordpress.com/2008/10/27/compound-undo-manager/
Here is a possible fix: https://github.com/nordfalk/jsyntaxpane/commit/5fc75594f8bc4df6e8f7096d4a440490b768fd46#diff-b3f8826824f551219879f1c798618c12R67
JMeter暂不支持JAVA9,下个JMeter版本应该会支持,大家可以在Bug 61529.
中帮助关注这方面的进展