0
votes

I have seen multiple questions asking something similar to what I'm asking but for some reason, it's not working for me. I'm using the Jmeter 3.3 app (the latest at this point in time) so maybe the advice doesn't work on the newest version of JMeter.

I'm trying to create a test plan with JMeter to test hitting my DB.

Database URL: jdbc:impala://server.domain.com:21050/default;auth=noSasl 
JDBC Driver class: com.cloudera.impala.core.ImpalaJDBCDriver

One answer/advice said to copy the jar (in my case ImpalaJDBC4.jar) to the lib dir, then restart JMeter, which I did. I also put it in the lib/ext dir too. However, it still doesn't work for me. I keep getting the same error in jmeter.log:

Uncaught Exception java.lang.NoClassDefFoundError: Could not initialize class com.cloudera.impala.core.ImpalaJDBCDriver. See log file for details.

Not sure if path matters but I run jmeter from:

$ ~/tmp/apache-jmeter-3.3> bin/jmeter
   and from
$ ~/tmp/apache-jmeter-3.3/bin> jmeter

Is there something I'm missing here? Am I putting it in the wrong place in JMeter? I know the driver class is there because I checked the contents of the jar file:

jar tvf ImpalaJDBC4.jar | less

2680 Thu Jan 04 08:11:12 PST 2018 com/cloudera/impala/core/ImpalaJDBCDriver.class

Thanks in advance for your help. I'm tired of banging my head against the wall.

Here are the logs. I tried to sanitize it so please ignore anything that might not be correct to do my sanitization.

2018-02-05 17:14:05,321 INFO o.a.j.u.JMeterUtils: Setting Locale to en_US 2018-02-05 17:14:05,331 INFO o.a.j.JMeter: Loading user properties from: /Users/first.last/tmp/apache-jmeter-3.3/bin/user.properties 2018-02-05 17:14:05,332 INFO o.a.j.JMeter: Loading system properties from: /Users/first.last/tmp/apache-jmeter-3.3/bin/system.properties 2018-02-05 17:14:05,336 INFO o.a.j.JMeter: Copyright (c) 1998-2017 The Apache Software Foundation 2018-02-05 17:14:05,336 INFO o.a.j.JMeter: Version 3.3 r1808647 2018-02-05 17:14:05,336 INFO o.a.j.JMeter: java.version=1.8.0_162 2018-02-05 17:14:05,336 INFO o.a.j.JMeter: java.vm.name=Java HotSpot(TM) 64-Bit Server VM 2018-02-05 17:14:05,336 INFO o.a.j.JMeter: os.name=Mac OS X 2018-02-05 17:14:05,336 INFO o.a.j.JMeter: os.arch=x86_64 2018-02-05 17:14:05,337 INFO o.a.j.JMeter: os.version=10.12.6 2018-02-05 17:14:05,337 INFO o.a.j.JMeter: file.encoding=UTF-8 2018-02-05 17:14:05,337 INFO o.a.j.JMeter: Max memory =536870912 2018-02-05 17:14:05,337 INFO o.a.j.JMeter: Available Processors =8 2018-02-05 17:14:05,340 INFO o.a.j.JMeter: Default Locale=English (United States) 2018-02-05 17:14:05,340 INFO o.a.j.JMeter: JMeter Locale=English (United States) 2018-02-05 17:14:05,340 INFO o.a.j.JMeter: JMeterHome=/Users/first.last/tmp/apache-jmeter-3.3 2018-02-05 17:14:05,340 INFO o.a.j.JMeter: user.dir =/Users/first.last/tmp/apache-jmeter-3.3 2018-02-05 17:14:05,341 INFO o.a.j.JMeter: PWD =/Users/first.last/tmp/apache-jmeter-3.3 2018-02-05 17:14:05,342 INFO o.a.j.JMeter: IP: 127.0.0.1 Name: MSJCIT1050435 FullName: localhost 2018-02-05 17:14:06,930 INFO o.a.j.g.a.LookAndFeelCommand: Using look and feel: com.apple.laf.AquaLookAndFeel [Mac OS X, System] 2018-02-05 17:14:06,935 INFO o.a.j.JMeter: Loaded icon properties from org/apache/jmeter/images/icon.properties 2018-02-05 17:14:07,722 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must contain the string: '.functions.' 2018-02-05 17:14:07,722 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must not contain the string: '.gui.' 2018-02-05 17:14:08,320 WARN o.j.r.PluginManager: Found JAR conflict: /Users/first.last/tmp/apache-jmeter-3.3/lib/ext/ImpalaJDBC4.jar and /Users/first.last/tmp/apache-jmeter-3.3/lib/ImpalaJDBC4.jar 2018-02-05 17:14:09,830 INFO o.j.r.PluginManager: Plugins Status: [jpgc-graphs-basic=2.0, jpgc-functions=2.0, jpgc-casutg=2.5, jpgc-dummy=0.2, jpgc-ffw=2.0, jpgc-fifo=0.2, jpgc-perfmon=2.1, jpgc-plugins-manager=0.19, jpgc-webdriver=2.3, jpgc-tst=2.1, webs ocket-sampler=1.0.2-SNAPSHOT, websocket-samplers=1.1, jmeter-core=3.3, jmeter-ftp=3.3, jmeter-http=3.3, jmeter-jdbc=3.3, jmeter-jms=3.3, jmeter-junit=3.3, jmeter-java=3.3, jmeter-ldap=3.3, jmeter-mail=3.3, jmeter-mongodb=3.3, jmeter-native=3.3, jmeter-tcp =3.3, jmeter-components=3.3, jpgc-standard=2.0] 2018-02-05 17:14:09,863 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.assertions.BSFAssertion 2018-02-05 17:14:09,964 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.extractor.BSFPostProcessor 2018-02-05 17:14:09,987 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.modifiers.BSFPreProcessor 2018-02-05 17:14:10,013 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/html is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser 2018-02-05 17:14:10,013 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for application/xhtml+xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser 2018-02-05 17:14:10,013 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for application/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser 2018-02-05 17:14:10,013 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/xml is org.apache.jmeter.protocol.http.parser.LagartoBasedHtmlParser 2018-02-05 17:14:10,013 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser 2018-02-05 17:14:10,013 INFO o.a.j.p.h.s.HTTPSamplerBase: Parser for text/css is org.apache.jmeter.protocol.http.parser.CssParser 2018-02-05 17:14:10,434 INFO o.a.j.e.KeyToolUtils: keytool found at 'keytool' 2018-02-05 17:14:10,435 INFO o.a.j.p.h.p.ProxyControl: HTTP(S) Test Script Recorder SSL Proxy will use keys that support embedded 3rd party resources in file /Users/first.last/tmp/apache-jmeter-3.3/bin/proxyserver.jks 2018-02-05 17:14:10,557 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.protocol.java.sampler.BSFSampler 2018-02-05 17:14:10,586 INFO o.a.j.s.FileServer: Default base='/Users/first.last/tmp/apache-jmeter-3.3' 2018-02-05 17:14:10,639 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.protocol.mongodb.config.MongoSourceElement 2018-02-05 17:14:10,639 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.protocol.mongodb.sampler.MongoScriptSampler 2018-02-05 17:14:10,727 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.timers.BSFTimer 2018-02-05 17:14:10,743 INFO o.a.j.g.u.MenuFactory: Skipping org.apache.jmeter.visualizers.BSFListener 2018-02-05 17:14:10,834 INFO o.a.j.s.SampleResult: Note: Sample TimeStamps are START times 2018-02-05 17:14:10,835 INFO o.a.j.s.SampleResult: sampleresult.default.encoding is set to ISO-8859-1 2018-02-05 17:14:10,835 INFO o.a.j.s.SampleResult: sampleresult.useNanoTime=true 2018-02-05 17:14:10,835 INFO o.a.j.s.SampleResult: sampleresult.nanoThreadSleep=5000 2018-02-05 17:14:40,008 INFO o.a.j.g.a.Load: Loading file: /Users/first.last/tmp/impala.jmx 2018-02-05 17:14:40,009 INFO o.a.j.s.FileServer: Set new base='/Users/first.last/tmp' 2018-02-05 17:14:40,125 INFO o.a.j.s.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2 2018-02-05 17:14:40,129 INFO o.a.j.s.SaveService: Using SaveService properties file encoding UTF-8 2018-02-05 17:14:40,130 INFO o.a.j.s.SaveService: Using SaveService properties version 3.2 2018-02-05 17:14:40,132 INFO o.a.j.s.SaveService: Loading file: /Users/first.last/tmp/impala.jmx 2018-02-05 17:14:40,479 INFO o.a.j.s.FileServer: Set new base='/Users/first.last/tmp' 2018-02-05 17:14:44,337 INFO o.a.j.e.StandardJMeterEngine: Running the test! 2018-02-05 17:14:44,337 INFO o.a.j.s.SampleEvent: List of sample_variables: [] 2018-02-05 17:14:44,337 INFO o.a.j.s.SampleEvent: List of sample_variables: [] 2018-02-05 17:14:44,356 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, local) 2018-02-05 17:14:44,516 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group 2018-02-05 17:14:44,517 INFO o.a.j.e.StandardJMeterEngine: Starting 3 threads for group Thread Group. 2018-02-05 17:14:44,517 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error 2018-02-05 17:14:44,517 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=3 ramp-up=1 perThread=333.33334 delayedStart=false 2018-02-05 17:14:44,521 INFO o.a.j.t.ThreadGroup: Started thread group number 1 2018-02-05 17:14:44,522 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started 2018-02-05 17:14:44,522 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-1 2018-02-05 17:14:44,525 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-1 2018-02-05 17:14:44,526 ERROR o.a.j.JMeter: Uncaught exception: java.lang.NoClassDefFoundError: org/apache/thrift/protocol/TProtocol at com.cloudera.impala.core.ImpalaJDBCDriver.(Unknown Source) ~[ImpalaJDBC4.jar:ImpalaJDBC_2.5.42.1062] at java.lang.Class.forName0(Native Method) ~[?:1.8.0_162] at java.lang.Class.forName(Class.java:264) ~[?:1.8.0_162] at org.apache.commons.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2124) ~[commons-dbcp2-2.1.1.jar:2.1.1] at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2033) ~[commons-dbcp2-2.1.1.jar:2.1.1] at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533) ~[commons-dbcp2-2.1.1.jar:2.1.1] at org.apache.jmeter.protocol.jdbc.config.DataSourceElement$DataSourceComponentImpl.getConnection(DataSourceElement.java:326) ~[ApacheJMeter_jdbc.jar:3.3 r1808647] at org.apache.jmeter.protocol.jdbc.config.DataSourceElement.getConnection(DataSourceElement.java:191) ~[ApacheJMeter_jdbc.jar:3.3 r1808647] at org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler.sample(JDBCSampler.java:79) ~[ApacheJMeter_jdbc.jar:3.3 r1808647] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:498) ~[ApacheJMeter_core.jar:3.3 r1808647] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:424) ~[ApacheJMeter_core.jar:3.3 r1808647] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255) ~[ApacheJMeter_core.jar:3.3 r1808647] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_162] Caused by: java.lang.ClassNotFoundException: org.apache.thrift.protocol.TProtocol at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_162] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_162] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_162] ... 13 more 2018-02-05 17:14:44,860 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-2 2018-02-05 17:14:44,862 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-2 2018-02-05 17:14:44,862 ERROR o.a.j.JMeter: Uncaught exception: java.lang.NoClassDefFoundError: Could not initialize class com.cloudera.impala.core.ImpalaJDBCDriver at java.lang.Class.forName0(Native Method) ~[?:1.8.0_162] at java.lang.Class.forName(Class.java:264) ~[?:1.8.0_162] at org.apache.commons.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2124) ~[commons-dbcp2-2.1.1.jar:2.1.1] at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2033) ~[commons-dbcp2-2.1.1.jar:2.1.1] at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533) ~[commons-dbcp2-2.1.1.jar:2.1.1] at org.apache.jmeter.protocol.jdbc.config.DataSourceElement$DataSourceComponentImpl.getConnection(DataSourceElement.java:326) ~[ApacheJMeter_jdbc.jar:3.3 r1808647] at org.apache.jmeter.protocol.jdbc.config.DataSourceElement.getConnection(DataSourceElement.java:191) ~[ApacheJMeter_jdbc.jar:3.3 r1808647] at org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler.sample(JDBCSampler.java:79) ~[ApacheJMeter_jdbc.jar:3.3 r1808647] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:498) ~[ApacheJMeter_core.jar:3.3 r1808647] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:424) ~[ApacheJMeter_core.jar:3.3 r1808647] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255) ~[ApacheJMeter_core.jar:3.3 r1808647] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_162] 2018-02-05 17:14:45,191 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-3 2018-02-05 17:14:45,192 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-3 2018-02-05 17:14:45,192 ERROR o.a.j.JMeter: Uncaught exception: java.lang.NoClassDefFoundError: Could not initialize class com.cloudera.impala.core.ImpalaJDBCDriver at java.lang.Class.forName0(Native Method) ~[?:1.8.0_162] at java.lang.Class.forName(Class.java:264) ~[?:1.8.0_162] at org.apache.commons.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2124) ~[commons-dbcp2-2.1.1.jar:2.1.1] at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2033) ~[commons-dbcp2-2.1.1.jar:2.1.1] at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533) ~[commons-dbcp2-2.1.1.jar:2.1.1] at org.apache.jmeter.protocol.jdbc.config.DataSourceElement$DataSourceComponentImpl.getConnection(DataSourceElement.java:326) ~[ApacheJMeter_jdbc.jar:3.3 r1808647] at org.apache.jmeter.protocol.jdbc.config.DataSourceElement.getConnection(DataSourceElement.java:191) ~[ApacheJMeter_jdbc.jar:3.3 r1808647] at org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler.sample(JDBCSampler.java:79) ~[ApacheJMeter_jdbc.jar:3.3 r1808647] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:498) ~[ApacheJMeter_core.jar:3.3 r1808647] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:424) ~[ApacheJMeter_core.jar:3.3 r1808647] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255) ~[ApacheJMeter_core.jar:3.3 r1808647] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_162] 2018-02-05 17:14:45,193 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test 2018-02-05 17:14:45,195 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, local)

1
can i see the logs?aswzen
@aswzen, attached the log from the run.Classified

1 Answers

1
votes

From the error you are missing class org/apache/thrift/protocol/TProtocol which is part of apache thrift jar - libthrift-X.X.X.jar. Impala driver have list of mandatory jars, See Configure Impala JDBC:

download the JAR files to each client machine that will use JDBC with Impala:... libthrift-X.X.X.jar

To enable JDBC support for Impala on the system where you run the JDBC application:

Download the JAR files listed above to each client machine.

Full list of dependencies:

commons-logging-X.X.X.jar hadoop-common.jar hive-common-X.XX.X-cdhX.X.X.jar hive-jdbc-X.XX.X-cdhX.X.X.jar hive-metastore-X.XX.X-cdhX.X.X.jar hive-service-X.XX.X-cdhX.X.X.jar httpclient-X.X.X.jar httpcore-X.X.X.jar libfb303-X.X.X.jar libthrift-X.X.X.jar log4j-X.X.XX.jar slf4j-api-X.X.X.jar slf4j-logXjXX-X.X.X.jar