NPE from JSyntaxTextArea when loading testplan with 1.9.0

43 views
Skip to first unread message

real....@gmail.com

unread,
Jan 22, 2014, 10:04:34 AM1/22/14
to maven-jmeter...@googlegroups.com
Hi folks,

i just upgraded from 1.8.1 to 1.9.0 because i needed the specify resultDir feature (by the way: thanks for that).

But now i can't open my Testplans in GUI mode. I just get an NPE when opening the testplan: (Non GUI mode seems to work though)

2014/01/22 16:00:07 WARN - jmeter.gui.action.Load: Unexpected error java.lang.NullPointerException
at java.util.Hashtable.get(Hashtable.java:334)
at java.util.Properties.getProperty(Properties.java:932)
at org.apache.jmeter.gui.util.JSyntaxTextArea.setLanguage(JSyntaxTextArea.java:96)
at org.apache.jmeter.testbeans.gui.TextAreaEditor.<init>(TextAreaEditor.java:84)
at org.apache.jmeter.testbeans.gui.TypeEditor$4.getInstance(TypeEditor.java:31)
at org.apache.jmeter.testbeans.gui.GenericTestBeanCustomizer.<init>(GenericTestBeanCustomizer.java:229)
at org.apache.jmeter.testbeans.gui.TestBeanGUI.init(TestBeanGUI.java:454)
at org.apache.jmeter.testbeans.gui.TestBeanGUI.configure(TestBeanGUI.java:325)
at org.apache.jmeter.gui.tree.JMeterTreeModel.addComponent(JMeterTreeModel.java:127)
at org.apache.jmeter.gui.tree.JMeterTreeModel.addSubTree(JMeterTreeModel.java:111)
at org.apache.jmeter.gui.tree.JMeterTreeModel.addSubTree(JMeterTreeModel.java:111)
at org.apache.jmeter.gui.tree.JMeterTreeModel.addSubTree(JMeterTreeModel.java:103)
at org.apache.jmeter.gui.GuiPackage.addSubTree(GuiPackage.java:467)
at org.apache.jmeter.gui.action.Load.insertLoadedTree(Load.java:198)
at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:136)
at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:105)
at org.apache.jmeter.gui.action.LoadRecentProject.doAction(LoadRecentProject.java:68)
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:81)
at org.apache.jmeter.gui.action.ActionRouter.access$000(ActionRouter.java:40)
at org.apache.jmeter.gui.action.ActionRouter$1.run(ActionRouter.java:63)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:672)
at java.awt.EventQueue.access$400(EventQueue.java:81)
at java.awt.EventQueue$2.run(EventQueue.java:633)
at java.awt.EventQueue$2.run(EventQueue.java:631)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:642)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

The code seems to load a properties file from the classpath in which it expects a specific property (language for some syntax highlighting). I had a look into the ApacheJMeter_core-2.10.jar in lib/ext and it seems like the file is there (org\apache\jmeter\gui\util\textarea.properties). But don't know which key it is looking for.

Not sure if that has anything to do with it, but i recognized that the libs from my jmeter plugins are no longer placed under lib/ext but directly within lib.

Regards,
Michael

real....@gmail.com

unread,
Jan 22, 2014, 10:18:51 AM1/22/14
to maven-jmeter...@googlegroups.com, real....@gmail.com

Hi,

by looking into the source code it seems that the key called "language" is null in the call to org.apache.jmeter.gui.util.JSyntaxTextArea.setLanguage(JSyntaxTextArea.java:96)

so that seems to be more a Jmeter bug itself than a problem of jmeter-maven-plugin

real....@gmail.com

unread,
Jan 22, 2014, 10:28:23 AM1/22/14
to maven-jmeter...@googlegroups.com, real....@gmail.com
Seems to be even worse ... for myself ;-)

My own jmeter plugin still had references to Jmeter 2.9 with scope "provided"

Damn me ... Sorry folks.

Regards,
Michael

real....@gmail.com

unread,
Jan 22, 2014, 10:37:00 AM1/22/14
to maven-jmeter...@googlegroups.com, real....@gmail.com
But this still wasn't all. So just for the case anybody finds this:

The problem was that the BeanInfo class for my sampler missed the line

p.setValue(TEXT_LANGUAGE, "xml"); // $NON-NLS-1$

after creating a TextArea property like this:

p = property("msgContent", TypeEditor.TextAreaEditor);

Ardesco

unread,
Jan 23, 2014, 5:56:38 AM1/23/14
to maven-jmeter...@googlegroups.com, real....@gmail.com
You also probably want to have a look at this:


if you want libraries copied into lib/ext you need to specify them in your plugin configuration
Reply all
Reply to author
Forward
0 new messages