You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2020/11/05 01:26:00 UTC

[Bug 64873] New: Exception in thread "Example Thread Group 1-1" java.lang.NoSuchMethodError: 'org.apache.http.impl.client.HttpClientBuilder org.apache.http.impl.client.HttpClientBuilder.setDnsResolver(org.apache.http.conn.DnsResolver)'

https://bz.apache.org/bugzilla/show_bug.cgi?id=64873

            Bug ID: 64873
           Summary: Exception in thread "Example Thread Group 1-1"
                    java.lang.NoSuchMethodError:
                    'org.apache.http.impl.client.HttpClientBuilder
                    org.apache.http.impl.client.HttpClientBuilder.setDnsRe
                    solver(org.apache.http.conn.DnsResolver)'
           Product: JMeter
           Version: 5.3
          Hardware: PC
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: Main
          Assignee: issues@jmeter.apache.org
          Reporter: lotulion@hotmail.com
  Target Milestone: JMETER_5.4

Created attachment 37545
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37545&action=edit
the file to reoccur the bug

When running the src file in the attached, the blocker issue raised but in the
previous version 5, it can work:

org.apache.jmeter.samplers.SampleResult:151 - sampl result.nanoThreadSleep=5000
2020-11-05 09:19:48,690 [Request-Id:] [Example Thread Group 1-1] INFO 
org.apache.jmeter.threads.JMeterThread:327 - Thread finished: Example Thread
Group 1-1
Exception in thread "Example Thread Group 1-1" java.lang.NoSuchMethodError:
'org.apache.http.impl.client.HttpClientBuilder
org.apache.http.impl.client.HttpClientBuilder.setDnsResolver(org.apache.http.conn.DnsResolver)'
        at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.setupClient(HTTPHC4Impl.java:1104)
        at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:613)
        at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66)
        at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1281)
        at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1270)
        at
org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:630)
        at
org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558)
        at
org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489)
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
        at java.base/java.lang.Thread.run(Thread.java:832)
2020-11-05 09:19:48,694 [Request-Id:] [main] INFO 
org.apache.jmeter.engine.StandardJMeterEngine:213 - Notifying test listeners of
end of test
2020-11-05 09:19:48,697 [Request-Id:] [main] INFO 
org.apache.jmeter.reporters.Summariser:326 - summary =      0 in 00:00:00 =
******/s Avg:     0 Min: 9223372036854775807 Max: -9223372036854775808 Err:    
0 (0.00%)
summary =      0 in 00:00:00 = ******/s Avg:     0 Min: 9223372036854775807
Max: -9223372036854775808 Err:     0 (0.00%)
Test completed. See
E:\Programing\JmeterRestAPI\JmeterInstallation\apache-jmeter-5.0\exampleQiuhuiDesign.jtl
file for results
JMeter .jmx script is available at
E:\Programing\JmeterRestAPI\JmeterInstallation\apache-jmeter-5.0\exampleQiuhuiDesign.jmx

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 64873] Exception in thread "Example Thread Group 1-1" java.lang.NoSuchMethodError: 'org.apache.http.impl.client.HttpClientBuilder org.apache.http.impl.client.HttpClientBuilder.setDnsResolver(org.apache.http.conn.DnsResolver)'

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64873

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |INVALID
                 CC|                            |p.mouawad@ubik-ingenierie.c
                   |                            |om

--- Comment #3 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Issue is not in JMeter but in custom setup

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 64873] Exception in thread "Example Thread Group 1-1" java.lang.NoSuchMethodError: 'org.apache.http.impl.client.HttpClientBuilder org.apache.http.impl.client.HttpClientBuilder.setDnsResolver(org.apache.http.conn.DnsResolver)'

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64873

Qiuhui Ling <lo...@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|blocker                     |critical

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 64873] Exception in thread "Example Thread Group 1-1" java.lang.NoSuchMethodError: 'org.apache.http.impl.client.HttpClientBuilder org.apache.http.impl.client.HttpClientBuilder.setDnsResolver(org.apache.http.conn.DnsResolver)'

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64873

--- Comment #1 from Qiuhui Ling <lo...@hotmail.com> ---
Comment on attachment 37545
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=37545
the file to reoccur the bug

>package com.cbim.dataservice.sample.testForJmeterSrc;
>
>import java.io.File;
>import java.io.FileOutputStream;
>
>import org.apache.jmeter.config.Arguments;
>import org.apache.jmeter.config.gui.ArgumentsPanel;
>import org.apache.jmeter.control.LoopController;
>import org.apache.jmeter.control.gui.LoopControlPanel;
>import org.apache.jmeter.control.gui.TestPlanGui;
>import org.apache.jmeter.engine.JMeterEngine;
>import org.apache.jmeter.engine.StandardJMeterEngine;
>import org.apache.jmeter.protocol.http.control.gui.HttpTestSampleGui;
>import org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy;
>import org.apache.jmeter.reporters.ResultCollector;
>import org.apache.jmeter.reporters.Summariser;
>import org.apache.jmeter.save.SaveService;
>import org.apache.jmeter.testelement.TestElement;
>import org.apache.jmeter.testelement.TestPlan;
>import org.apache.jmeter.threads.ThreadGroup;
>import org.apache.jmeter.threads.gui.ThreadGroupGui;
>import org.apache.jmeter.util.JMeterUtils;
>import org.apache.jorphan.collections.HashTree;
>
>public class JMeterFromScratch_StandEngine5 {
>
>    public static void main(String[] argv) throws Exception {
>        // 设置jmeterHomeè·¯å¾
>        String jmeterHome1 = "E:\\Programing\\JmeterRestAPI\\JmeterInstallation\\apache-jmeter-5.0";
>        //File jmeterHome = new File(System.getProperty("jmeter.home"));
>        File jmeterHome = new File(jmeterHome1);
>        String slash = System.getProperty("file.separator");
>
>        if (jmeterHome.exists()) {
>            File jmeterProperties = new File(jmeterHome.getPath() + slash + "bin" + slash + "jmeter.properties");
>            if (jmeterProperties.exists()) {
>                //JMeter Engine å¼æ
>            	//qiuhui comment 2020-11-2
>                //StandardJMeterEngine jmeter = new StandardJMeterEngine();
>                JMeterEngine jmeter = new StandardJMeterEngine();
>
>                //JMeter initialization (properties, log levels, locale, etc)
>                JMeterUtils.setJMeterHome(jmeterHome.getPath());
>                JMeterUtils.loadJMeterProperties(jmeterProperties.getPath());
>                JMeterUtils.initLogging();// you can comment this line out to see extra log messages of i.e. DEBUG level
>                JMeterUtils.initLocale();
>
>
>                // JMeter Test Plan, basically JOrphan HashTree
>                HashTree testPlanTree = new HashTree();
>
>                // 第ä¸ä¸ª HTTP Sampler - æå¼ baidu.com
>                HTTPSamplerProxy examplecomSampler = new HTTPSamplerProxy();
>                examplecomSampler.setDomain("baidu.com");
>                examplecomSampler.setPort(80);
>                examplecomSampler.setPath("/");
>                examplecomSampler.setMethod("GET");
>                examplecomSampler.setName("Open baidu.com");
>                examplecomSampler.setProperty(TestElement.TEST_CLASS, HTTPSamplerProxy.class.getName());
>                examplecomSampler.setProperty(TestElement.GUI_CLASS, HttpTestSampleGui.class.getName());
>
>
>                // 第äºä¸ª HTTP Sampler - æå¼ qq.com
>                HTTPSamplerProxy blazemetercomSampler = new HTTPSamplerProxy();
>                blazemetercomSampler.setDomain("qq.com");
>                blazemetercomSampler.setPort(80);
>                blazemetercomSampler.setPath("/?fromdefault");
>                blazemetercomSampler.setMethod("GET");
>                blazemetercomSampler.setName("Open qq.com");
>                blazemetercomSampler.setProperty(TestElement.TEST_CLASS, HTTPSamplerProxy.class.getName());
>                blazemetercomSampler.setProperty(TestElement.GUI_CLASS, HttpTestSampleGui.class.getName());
>
>
>                // Loop Controller 循ç¯æ§å¶
>                LoopController loopController = new LoopController();
>                loopController.setLoops(1);
>                loopController.setFirst(true);
>                loopController.setProperty(TestElement.TEST_CLASS, LoopController.class.getName());
>                loopController.setProperty(TestElement.GUI_CLASS, LoopControlPanel.class.getName());
>                loopController.initialize();
>
>                // Thread Group 线ç¨ç»
>                ThreadGroup threadGroup = new ThreadGroup();
>                threadGroup.setName("Example Thread Group");
>                threadGroup.setNumThreads(1);
>                threadGroup.setRampUp(1);
>                threadGroup.setSamplerController(loopController);
>                threadGroup.setProperty(TestElement.TEST_CLASS, ThreadGroup.class.getName());
>                threadGroup.setProperty(TestElement.GUI_CLASS, ThreadGroupGui.class.getName());
>
>                // Test Plan æµè¯è®¡å
>                TestPlan testPlan = new TestPlan("Create JMeter Script From Java Code");
>                testPlan.setProperty(TestElement.TEST_CLASS, TestPlan.class.getName());
>                testPlan.setProperty(TestElement.GUI_CLASS, TestPlanGui.class.getName());
>                testPlan.setUserDefinedVariables((Arguments) new ArgumentsPanel().createTestElement());
>
>                // Construct Test Plan from previously initialized elements
>                // ä»ä»¥ä¸åå§åçåç´ æé æµè¯è®¡å
>                testPlanTree.add(testPlan);
>                HashTree threadGroupHashTree = testPlanTree.add(testPlan, threadGroup);
>                threadGroupHashTree.add(blazemetercomSampler);
>                threadGroupHashTree.add(examplecomSampler);
>
>                // save generated test plan to JMeter's .jmx file format
>                // å°çæçæµè¯è®¡åä¿å­ä¸ºJMeterç.jmxæ件格å¼
>                SaveService.saveTree(testPlanTree, new FileOutputStream(jmeterHome + slash + "exampleQiuhuiDesign.jmx"));
>
>                //add Summarizer output to get test progress in stdout like:
>                // å¨stdout中添å summaryè¾åºï¼å¾å°æµè¯è¿åº¦ï¼å¦:
>                // summary =      2 in   1.3s =    1.5/s Avg:   631 Min:   290 Max:   973 Err:     0 (0.00%)
>                Summariser summer = null;
>                String summariserName = JMeterUtils.getPropDefault("summariser.name", "summary");
>                if (summariserName.length() > 0) {
>                    summer = new Summariser(summariserName);
>                }
>
>
>                // Store execution results into a .jtl file
>                // å°æ§è¡ç»æå­å¨å°.jtlæ件中
>                String logFile = jmeterHome + slash + "exampleQiuhuiDesign.jtl";
>                ResultCollector logger = new ResultCollector(summer);
>                logger.setFilename(logFile);
>                testPlanTree.add(testPlanTree.getArray()[0], logger);
>                
>               
>                // Run Test Plan
>                // æ§è¡æµè¯è®¡å
>                jmeter.configure(testPlanTree);        
>                //qiuhui comments 2020-11-2
>                //jmeter.run();
>                ((StandardJMeterEngine) jmeter).run();
>
>               
>                System.out.println("Test completed. See " + jmeterHome + slash + "exampleQiuhuiDesign.jtl file for results");
>                System.out.println("JMeter .jmx script is available at " + jmeterHome + slash + "exampleQiuhuiDesign.jmx");
>                System.exit(0);
>                 
>            }
>        }
>
>        System.err.println("jmeter.home property is not set or pointing to incorrect location");
>        System.exit(1);
>
>
>    }
>}

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 64873] Exception in thread "Example Thread Group 1-1" java.lang.NoSuchMethodError: 'org.apache.http.impl.client.HttpClientBuilder org.apache.http.impl.client.HttpClientBuilder.setDnsResolver(org.apache.http.conn.DnsResolver)'

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64873

Felix Schumacher <fe...@internetallee.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
           Severity|critical                    |normal

--- Comment #2 from Felix Schumacher <fe...@internetallee.de> ---
This seems to be a rather involved custom setup. Most likely you are using a
different jar for the httpclient to the one originally bundled with JMeter.

Which libraries are on your classpath? (Especially interesting are the ones
that contain the class org.apache.http.impl.client.HttpClientBuilder.)

What happens, when you use JMeter directly without your custom starter code?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 64873] Exception in thread "Example Thread Group 1-1" java.lang.NoSuchMethodError: 'org.apache.http.impl.client.HttpClientBuilder org.apache.http.impl.client.HttpClientBuilder.setDnsResolver(org.apache.http.conn.DnsResolver)'

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64873

Qiuhui Ling <lo...@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
                 CC|                            |lotulion@hotmail.com

-- 
You are receiving this mail because:
You are the assignee for the bug.