jmeter常见问题

问题1:javax.swing.text.BadLocationException: Position not represented by view 

解决方法

jmeter常见问题_第1张图片

问题2:Could not instantiate class: kg.apc.jmeter.reporters.LoadosophiaUploaderGui

2022-07-01 18:02:52,673 INFO k.a.j.JMeterPluginsUtils: JMeter-Plugins.org v.1.4.0
2022-07-01 18:02:52,733 WARN o.a.j.g.u.MenuFactory: Could not instantiate class: kg.apc.jmeter.reporters.LoadosophiaUploaderGui
java.lang.reflect.InvocationTargetException: null
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_221]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_221]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_221]
	at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_221]
	at org.apache.jmeter.gui.util.MenuFactory.getGUIComponent(MenuFactory.java:207) ~[ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.gui.util.MenuFactory.initializeMenus(MenuFactory.java:151) ~[ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.gui.util.MenuFactory.(MenuFactory.java:107) ~[ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.control.gui.TestPlanGui.createPopupMenu(TestPlanGui.java:94) ~[ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.gui.tree.JMeterTreeNode.createPopupMenu(JMeterTreeNode.java:184) ~[ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.gui.action.EditCommand.doAction(EditCommand.java:46) ~[ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:87) ~[ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$0(ActionRouter.java:69) ~[ApacheJMeter_core.jar:5.4.1]
	at java.awt.event.InvocationEvent.dispatch(Unknown Source) ~[?:1.8.0_221]
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source) ~[?:1.8.0_221]
	at java.awt.EventQueue.access$500(Unknown Source) ~[?:1.8.0_221]
	at java.awt.EventQueue$3.run(Unknown Source) ~[?:1.8.0_221]
	at java.awt.EventQueue$3.run(Unknown Source) ~[?:1.8.0_221]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_221]
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) ~[?:1.8.0_221]
	at java.awt.EventQueue.dispatchEvent(Unknown Source) ~[?:1.8.0_221]
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) ~[?:1.8.0_221]
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) ~[?:1.8.0_221]
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) ~[?:1.8.0_221]
	at java.awt.WaitDispatchSupport$2.run(Unknown Source) ~[?:1.8.0_221]
	at java.awt.WaitDispatchSupport$4.run(Unknown Source) ~[?:1.8.0_221]
	at java.awt.WaitDispatchSupport$4.run(Unknown Source) ~[?:1.8.0_221]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_221]
	at java.awt.WaitDispatchSupport.enter(Unknown Source) ~[?:1.8.0_221]
	at java.awt.Dialog.show(Unknown Source) ~[?:1.8.0_221]
	at java.awt.Component.show(Unknown Source) ~[?:1.8.0_221]
	at java.awt.Component.setVisible(Unknown Source) ~[?:1.8.0_221]
	at java.awt.Window.setVisible(Unknown Source) ~[?:1.8.0_221]
	at java.awt.Dialog.setVisible(Unknown Source) ~[?:1.8.0_221]
	at org.apache.jmeter.SplashScreen.lambda$showScreen$0(SplashScreen.java:95) ~[ApacheJMeter_core.jar:5.4.1]
	at java.awt.event.InvocationEvent.dispatch(Unknown Source) [?:1.8.0_221]
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source) [?:1.8.0_221]
	at java.awt.EventQueue.access$500(Unknown Source) [?:1.8.0_221]
	at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_221]
	at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_221]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_221]
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) [?:1.8.0_221]
	at java.awt.EventQueue.dispatchEvent(Unknown Source) [?:1.8.0_221]
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) [?:1.8.0_221]
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) [?:1.8.0_221]
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) [?:1.8.0_221]
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_221]
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_221]
	at java.awt.EventDispatchThread.run(Unknown Source) [?:1.8.0_221]
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/httpclient/methods/multipart/PartSource
	at kg.apc.jmeter.reporters.LoadosophiaUploaderGui.init(LoadosophiaUploaderGui.java:114) ~[JMeterPlugins-Standard.jar:?]
	at kg.apc.jmeter.reporters.LoadosophiaUploaderGui.(LoadosophiaUploaderGui.java:28) ~[JMeterPlugins-Standard.jar:?]
	... 48 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.methods.multipart.PartSource
	at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_221]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_221]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_221]
	at kg.apc.jmeter.reporters.LoadosophiaUploaderGui.init(LoadosophiaUploaderGui.java:114) ~[JMeterPlugins-Standard.jar:?]
	at kg.apc.jmeter.reporters.LoadosophiaUploaderGui.(LoadosophiaUploaderGui.java:28) ~[JMeterPlugins-Standard.jar:?]
	... 48 more

问题3:String r . . . '' Encountered "JSONObject" at line 7, column 1.

2022-07-01 17:35:55,318 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2022-07-01 17:35:55,319 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2022-07-01 17:35:55,319 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2022-07-01 17:35:55,320 INFO o.a.j.e.StandardJMeterEngine: Starting setUp thread groups
2022-07-01 17:35:55,320 INFO o.a.j.e.StandardJMeterEngine: Starting setUp ThreadGroup: 1 : setUp Thread Group 
2022-07-01 17:35:55,320 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group setUp Thread Group.
2022-07-01 17:35:55,320 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2022-07-01 17:35:55,320 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false
2022-07-01 17:35:55,323 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2022-07-01 17:35:55,323 INFO o.a.j.e.StandardJMeterEngine: Waiting for all setup thread groups to exit
2022-07-01 17:35:55,323 INFO o.a.j.t.JMeterThread: Thread started: setUp Thread Group 1-1
2022-07-01 17:35:55,326 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval	In file: inline evaluation of: ``//先引入jar包 import json.*; import org.Application;  String r . . . '' Encountered "JSONObject" at line 7, column 1.

2022-07-01 17:35:55,326 WARN o.a.j.a.BeanShellAssertion: Error in BeanShellAssertion
org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval	In file: inline evaluation of: ``//先引入jar包 import json.*; import org.Application;  String r . . . '' Encountered "JSONObject" at line 7, column 1.

	at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:179) ~[ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.util.BeanShellInterpreter.eval(BeanShellInterpreter.java:185) ~[ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.util.BeanShellTestElement.processFileOrScript(BeanShellTestElement.java:150) ~[ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.assertions.BeanShellAssertion.getResult(BeanShellAssertion.java:106) [ApacheJMeter_components.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.processAssertion(JMeterThread.java:931) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.checkAssertions(JMeterThread.java:900) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:574) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.4.1]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_221]
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_221]
	at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:162) ~[ApacheJMeter_core.jar:5.4.1]
	... 9 more
Caused by: bsh.ParseException: In file: inline evaluation of: ``//先引入jar包 import json.*; import org.Application;  String r . . . '' Encountered "JSONObject" at line 7, column 1.

	at bsh.Parser.generateParseException(Parser.java:6106) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Parser.jj_consume_token(Parser.java:5977) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Parser.Statement(Parser.java:2699) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Parser.BlockStatement(Parser.java:2819) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Parser.Line(Parser.java:172) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Interpreter.Line(Interpreter.java:1011) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Interpreter.eval(Interpreter.java:641) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Interpreter.eval(Interpreter.java:750) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Interpreter.eval(Interpreter.java:739) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_221]
	at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:162) ~[ApacheJMeter_core.jar:5.4.1]
	... 9 more
2022-07-01 17:35:55,327 INFO o.a.j.t.JMeterThread: Thread is done: setUp Thread Group 1-1
2022-07-01 17:35:55,327 INFO o.a.j.t.JMeterThread: Thread finished: setUp Thread Group 1-1
2022-07-01 17:35:55,327 INFO o.a.j.e.StandardJMeterEngine: All Setup Threads have ended
2022-07-01 17:35:55,411 INFO o.a.j.e.StandardJMeterEngine: No enabled thread groups found
2022-07-01 17:35:55,411 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2022-07-01 17:35:55,411 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
2022-07-01 17:36:42,372 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2022-07-01 17:36:42,373 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2022-07-01 17:36:42,373 INFO o.a.j.t.TestPlan: added D:\性能\jmeter\openapi.jar to classpath
2022-07-01 17:36:42,374 INFO o.a.j.t.TestPlan: added D:\性能\jmeter\json.jar to classpath
2022-07-01 17:36:42,374 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2022-07-01 17:36:42,374 INFO o.a.j.e.StandardJMeterEngine: Starting setUp thread groups
2022-07-01 17:36:42,374 INFO o.a.j.e.StandardJMeterEngine: Starting setUp ThreadGroup: 1 : setUp Thread Group 
2022-07-01 17:36:42,374 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group setUp Thread Group.
2022-07-01 17:36:42,374 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2022-07-01 17:36:42,374 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false
2022-07-01 17:36:42,377 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2022-07-01 17:36:42,377 INFO o.a.j.e.StandardJMeterEngine: Waiting for all setup thread groups to exit
2022-07-01 17:36:42,378 INFO o.a.j.t.JMeterThread: Thread started: setUp Thread Group 1-1
2022-07-01 17:36:42,380 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval	In file: inline evaluation of: ``//先引入jar包 import org.json.*; import org.Application;  Stri . . . '' Encountered "JSONObject" at line 7, column 1.

2022-07-01 17:36:42,380 WARN o.a.j.a.BeanShellAssertion: Error in BeanShellAssertion
org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval	In file: inline evaluation of: ``//先引入jar包 import org.json.*; import org.Application;  Stri . . . '' Encountered "JSONObject" at line 7, column 1.

	at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:179) ~[ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.util.BeanShellInterpreter.eval(BeanShellInterpreter.java:185) ~[ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.util.BeanShellTestElement.processFileOrScript(BeanShellTestElement.java:150) ~[ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.assertions.BeanShellAssertion.getResult(BeanShellAssertion.java:106) [ApacheJMeter_components.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.processAssertion(JMeterThread.java:931) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.checkAssertions(JMeterThread.java:900) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:574) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.4.1]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_221]
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_221]
	at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:162) ~[ApacheJMeter_core.jar:5.4.1]
	... 9 more
Caused by: bsh.ParseException: In file: inline evaluation of: ``//先引入jar包 import org.json.*; import org.Application;  Stri . . . '' Encountered "JSONObject" at line 7, column 1.

	at bsh.Parser.generateParseException(Parser.java:6106) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Parser.jj_consume_token(Parser.java:5977) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Parser.Statement(Parser.java:2699) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Parser.BlockStatement(Parser.java:2819) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Parser.Line(Parser.java:172) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Interpreter.Line(Interpreter.java:1011) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Interpreter.eval(Interpreter.java:641) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Interpreter.eval(Interpreter.java:750) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Interpreter.eval(Interpreter.java:739) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_221]
	at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:162) ~[ApacheJMeter_core.jar:5.4.1]
	... 9 more
2022-07-01 17:36:42,381 INFO o.a.j.t.JMeterThread: Thread is done: setUp Thread Group 1-1
2022-07-01 17:36:42,381 INFO o.a.j.t.JMeterThread: Thread finished: setUp Thread Group 1-1
2022-07-01 17:36:42,381 INFO o.a.j.e.StandardJMeterEngine: All Setup Threads have ended
2022-07-01 17:36:42,462 INFO o.a.j.e.StandardJMeterEngine: No enabled thread groups found
2022-07-01 17:36:42,462 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2022-07-01 17:36:42,462 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)

解决方法:调整相应的脚本,添加相应的log打印,进行问题的排查

问题4:Caused by: org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]

2022-07-01 18:41:47,182 INFO o.a.j.t.JMeterThread: Thread started: setUp Thread Group 1-1
2022-07-01 18:41:47,186 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval	Sourced file: inline evaluation of: ``//先引入jar包 import org.json.JSONObject; import org.json.JSONArray '' : Typed variable declaration : Object constructor
2022-07-01 18:41:47,186 WARN o.a.j.a.BeanShellAssertion: Error in BeanShellAssertion
org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval	Sourced file: inline evaluation of: ``//先引入jar包 import org.json.JSONObject; import org.json.JSONArray; '' : Typed variable declaration : Object constructor
	at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:179) ~[ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.util.BeanShellInterpreter.eval(BeanShellInterpreter.java:185) ~[ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.util.BeanShellTestElement.processFileOrScript(BeanShellTestElement.java:150) ~[ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.assertions.BeanShellAssertion.getResult(BeanShellAssertion.java:106) [ApacheJMeter_components.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.processAssertion(JMeterThread.java:931) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.checkAssertions(JMeterThread.java:900) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:574) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.4.1]
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.4.1]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_221]
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_221]
	at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:162) ~[ApacheJMeter_core.jar:5.4.1]
	... 9 more
Caused by: bsh.TargetError: Sourced file: inline evaluation of: ``//先引入jar包 import org.json.JSONObject; import org.json.JSONArray;'' : Typed variable declaration : Object constructor
	at bsh.BSHAllocationExpression.constructObject(BSHAllocationExpression.java:126) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.BSHAllocationExpression.objectAllocation(BSHAllocationExpression.java:108) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.BSHAllocationExpression.eval(BSHAllocationExpression.java:56) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:96) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:41) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.BSHVariableDeclarator.eval(BSHVariableDeclarator.java:80) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.BSHTypedVariableDeclaration.eval(BSHTypedVariableDeclaration.java:78) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Interpreter.eval(Interpreter.java:659) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Interpreter.eval(Interpreter.java:750) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Interpreter.eval(Interpreter.java:739) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_221]
	at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:162) ~[ApacheJMeter_core.jar:5.4.1]
	... 9 more
Caused by: org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
	at org.json.JSONTokener.syntaxError(JSONTokener.java:451) ~[org.json.jar:?]
	at org.json.JSONObject.(JSONObject.java:195) ~[org.json.jar:?]
	at org.json.JSONObject.(JSONObject.java:319) ~[org.json.jar:?]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_221]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_221]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_221]
	at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_221]
	at bsh.Reflect.constructObject(Reflect.java:621) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.BSHAllocationExpression.constructObject(BSHAllocationExpression.java:117) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.BSHAllocationExpression.objectAllocation(BSHAllocationExpression.java:108) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.BSHAllocationExpression.eval(BSHAllocationExpression.java:56) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:96) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:41) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.BSHVariableDeclarator.eval(BSHVariableDeclarator.java:80) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.BSHTypedVariableDeclaration.eval(BSHTypedVariableDeclaration.java:78) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Interpreter.eval(Interpreter.java:659) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Interpreter.eval(Interpreter.java:750) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at bsh.Interpreter.eval(Interpreter.java:739) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_221]
	at org.apache.jmeter.util.BeanShellInterpreter.bshInvoke(BeanShellInterpreter.java:162) ~[ApacheJMeter_core.jar:5.4.1]
	... 9 more
2022-07-01 18:41:47,187 INFO o.a.j.t.JMeterThread: Thread is done: setUp Thread Group 1-1
2022-07-01 18:41:47,187 INFO o.a.j.t.JMeterThread: Thread finished: setUp Thread Group 1-1
2022-07-01 18:41:47,187 INFO o.a.j.e.StandardJMeterEngine: All Setup Threads have ended
2022-07-01 18:41:47,282 INFO o.a.j.e.StandardJMeterEngine: No enabled thread groups found
2022-07-01 18:41:47,283 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2022-07-01 18:41:47,283 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)

解决方法:调整相应的脚本,添加相应的log打印,进行问题的排查

问题5:提示jmeter内存溢出修改后的验证方法

jmeter常见问题_第2张图片

jmeter常见问题_第3张图片

你可能感兴趣的:(日常排错,测试工具)