Jmeter error org.postgresql.jdbc3g.Jdbc3gConnection.isValid(I)Z - postgresql

I am geting the following error when i run a test scenario...I am using
postgresql-42.4.1 jar ,
java.lang.AbstractMethodError: org.postgresql.jdbc3g.Jdbc3gConnection.isValid(I)Z at
org.apache.commons.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:590)
~[commons-dbcp2-2.9.0.jar:2.9.0] at
org.apache.commons.dbcp2.PoolableConnection.validate(PoolableConnection.java:334)
~[commons-dbcp2-2.9.0.jar:2.9.0] at
org.apache.commons.dbcp2.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:653)
~[commons-dbcp2-2.9.0.jar:2.9.0] at
org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:109)
~[commons-dbcp2-2.9.0.jar:2.9.0] at
org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:649)
~[commons-dbcp2-2.9.0.jar:2.9.0] at
org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:531)
~[commons-dbcp2-2.9.0.jar:2.9.0] at
org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:731)
~[commons-dbcp2-2.9.0.jar:2.9.0] at
org.apache.jmeter.protocol.jdbc.config.DataSourceElement$DataSourceComponentImpl.getConnection(DataSourceElement.java:362)
~[ApacheJMeter_jdbc.jar:5.5] at
org.apache.jmeter.protocol.jdbc.config.DataSourceElement.getConnection(DataSourceElement.java:199)
~[ApacheJMeter_jdbc.jar:5.5] at
org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler.sample(JDBCSampler.java:80)
~[ApacheJMeter_jdbc.jar:5.5] at
org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651)
~[ApacheJMeter_core.jar:5.5] at
org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570)
~[ApacheJMeter_core.jar:5.5] at
org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501)
~[ApacheJMeter_core.jar:5.5] at
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268)
~[ApacheJMeter_core.jar:5.5] at
java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_301]

Try using SELECT 1 as the validation query:
More information:
DBCP - validationQuery for different Databases
How to use Different JDBC Drivers

Related

java.lang.RuntimeException: Failed to resolve Oracle database version

I am using debezium oracle connector in kafka connect.While starting connector I am getting below error,
java.lang.RuntimeException: Failed to resolve Oracle database version
at io.debezium.connector.oracle.OracleConnection.resolveOracleDatabaseVersion(OracleConnection.java:159)
at io.debezium.connector.oracle.OracleConnection.<init>(OracleConnection.java:71)
at io.debezium.connector.oracle.OracleConnector.validateConnection(OracleConnector.java:74)
at io.debezium.connector.common.RelationalBaseSourceConnector.validate(RelationalBaseSourceConnector.java:52)
at org.apache.kafka.connect.runtime.AbstractHerder.validateConnectorConfig(AbstractHerder.java:400)
at org.apache.kafka.connect.runtime.AbstractHerder.lambda$validateConnectorConfig$2(AbstractHerder.java:351)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:#**.**.*.**:1521/CDB
at java.sql.DriverManager.getConnection(DriverManager.java:689)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at io.debezium.jdbc.JdbcConnection.lambda$patternBasedFactory$0(JdbcConnection.java:184)
at io.debezium.jdbc.JdbcConnection$ConnectionFactoryDecorator.connect(JdbcConnection.java:121)
at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:890)
at io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:885)
at io.debezium.jdbc.JdbcConnection.queryAndMap(JdbcConnection.java:643)
at io.debezium.jdbc.JdbcConnection.queryAndMap(JdbcConnection.java:517)
at io.debezium.connector.oracle.OracleConnection.resolveOracleDatabaseVersion(OracleConnection.java:129)
... 10 more
I am refering to the link for oracle setup and connector configuration,
**https://debezium.io/documentation/reference/connectors/oracle.html#setting-up-oracle**
connector-configuration.properties
name=debeziumoraclesource
connector.class=io.debezium.connector.oracle.OracleConnector
database.hostname=**.*.**.**
database.port=1521
database.user=username
database.password=password
database.dbname=CDBNAME
database.server.name=**.*.**.**
tasks.max=1
database.pdb.name=PDBNAME
database.history.kafka.bootstrap.servers=kafka:9092
database.history.kafka.topic=history.ENTITY_GROUP_PARAMETER_VALUES
database.connection.adaptor=logminer
snapshot.mode=initial
table.include.list=schema.ENTITY_GROUP_PARAMETER_VALUES
Also I have download ojdbc8.jar and placed inside kafka/libs folder.I have tried using different version of jars like ojdbc10 and different versions of ojdbc8.Nothing helped me.Also to the point of note I am using oracle19c.Please help me in resolving this issue.Thanks in advance.
Using OJDBC6.jar with all dependencies helped me to resolve the issue. And most importantly i placed the jars in connectors lib folder.
Using OJDBC8.jar helped me solve the problem, the problem appeared as I didn't place the jar on all the servers that were running kafka connect.

SpringBoot application in Tomcat server: PostgreSQL Driver Not Found

I am using Spring boot application to develop Postgresql based application using Eclipse IDE(openjdk version 1.8.0_151)
I have configured gradle as follows:
compile group: 'org.postgresql', name: 'postgresql', version: '42.1.4'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc'
I am using Spring JdbcTemplate to access database. Everything works perfect in Eclipse IDE. I want to create a war file and deploy into Tomcat 9 server. But unfortunately, I got the following error message:
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: No suitable driver found for jdbc:postgresql://server:5432/db_pm
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:619)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:684)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:716)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:726)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:776)
at org.springframework.jdbc.core.JdbcTemplate.queryForList(JdbcTemplate.java:853)
at com.kpaudel.pm.PasswordManagerDAO.getSimilarServices(PasswordManagerDAO.java:108)
at com.kpaudel.pm.PasswordManagerDAO$$FastClassBySpringCGLIB$$482fbdc8.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
at com.kpaudel.pm.PasswordManagerDAO$$EnhancerBySpringCGLIB$$8f3e1618.getSimilarServices(<generated>)
at com.kpaudel.telegram.bots.PasswordManagerBot.onUpdateReceived(PasswordManagerBot.java:87)
at java.util.ArrayList.forEach(ArrayList.java:1255)
at org.telegram.telegrambots.generics.LongPollingBot.onUpdatesReceived(LongPollingBot.java:27)
at org.telegram.telegrambots.updatesreceivers.DefaultBotSession$HandlerThread.run(DefaultBotSession.java:301)
Caused by: java.sql.SQLException: No suitable driver found for jdbc:postgresql://server:5432/db_pm
at java.sql.DriverManager.getConnection(DriverManager.java:689)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:153)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:144)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:196)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:159)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
... 19 common frames omitted
I have copied Postgresql driver (postgresql-42.1.4.jar) into $CATALINA_HOME/lib directory also, that also did not help.

Check Sum error in JHipster when editing an existing entity generated using the entity wizard

I am using Postgresql for my db and created all the entities using the JHipster entity wizard. When I try to make any changes like adding/removing fields, relations to an existing entity I am getting a check sum error and Liquibase is not starting. Also, I haven't made any changes on the DB manually.
Any help is appreciated. Thanks. Here is the error I am getting:
2016-12-07 07:36:12.136 ERROR 8644 --- [cker-Executor-1] i.f.p.c.liquibase.AsyncSpringLiquibase : Liquibase could not start correctly, your database is NOT ready: Validation Failed:
1 change sets check sum
classpath:config/liquibase/changelog/20161205191514_added_entity_Person.xml::20161205191514-1::jhipster is now: 7:b92d6a054bbdf952b81fa58376bd6a75
liquibase.exception.ValidationFailedException: Validation Failed:
1 change sets check sum
classpath:config/liquibase/changelog/20161205191514_added_entity_Person.xml::20161205191514-1::jhipster is now: 7:b92d6a054bbdf952b81fa58376bd6a75
at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:215)
at liquibase.Liquibase.update(Liquibase.java:208)
at liquibase.Liquibase.update(Liquibase.java:192)
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:434)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:391)
at in.factly.promisetracker.config.liquibase.AsyncSpringLiquibase.initDb(AsyncSpringLiquibase.java:67)
at in.factly.promisetracker.config.liquibase.AsyncSpringLiquibase.lambda$afterPropertiesSet$3(AsyncSpringLiquibase.java:50)
at in.factly.promisetracker.config.liquibase.AsyncSpringLiquibase$$Lambda$28/847553836.run(Unknown Source)
at in.factly.promisetracker.async.ExceptionHandlingAsyncTaskExecutor.lambda$createWrappedRunnable$1(ExceptionHandlingAsyncTaskExecutor.java:47)
at in.factly.promisetracker.async.ExceptionHandlingAsyncTaskExecutor$$Lambda$29/342644967.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Executed the following query in Postgres DB which resolved the issue:
UPDATE databasechangelog SET md5sum = null
Can you try maven goal mvn liquibase:clearCheckSums and then try running app again
Hope this helps
For Gradle projects run task liquibaseClearChecksums, eg.:
./gradlew liquibaseClearChecksums
if you are using maven :
mvn liquibase:clearCheckSums
else if you are using gradle :
./gradlew liquibaseClearChecksums

Failed to connect to localhost orientdb using jdbc

I'm using OrientDB 2.1.9 and has created plocal graph database called 'TimespentEvents'.
When trying to connect from Java using JDBC driver in the same machine with URL 'jdbc:orient:remote:localhost/TimespentEvents' and user/password admin/admin I encounter the following exception:
Caused by: com.orientechnologies.orient.core.exception.OConfigurationException: Error on opening database: the engine 'remote' was not found. URL was: remote:localhost/TimespentEvents. Registered engines are: [plocal, memory]
When changing the URL into 'jdbc:orient:plocal:TimespentEvents' the error turns into:
Caused by: com.orientechnologies.orient.core.exception.OStorageException: Cannot open the storage 'TimespentEvents' because it does not exist in path: localhost/TimespentEvents
Below is the jdbc driver jars I include in the classpath:
orientdb-jdbc-2.1.9.jar
orientdb-core-2.1.9.jar
Any help would be greatly appreciated.
Thanks & Regards,
Setya
Turns out I have to include 2 additional jars:
orientdb-enterprise-2.1.9.jar
orientdb-client-2.1.9.jar
Thanks & Regards,
Setya

MongoDB hadoop connector fails to query on mongo hive table

I am using MongoDB hadoop connector to query mongoDB using hive table in hadoop.
I am able to execute
select * from mongoDBTestHiveTable;
But when I try to execute following query
select id from mongoDBTestHiveTable;
it throws following exception.
Following class exist in hive lib folder.
Exception stacktrace:
Diagnostic Messages for this Task:
Error: java.io.IOException: Cannot create an instance of InputSplit class = com.mongodb.hadoop.hive.input.HiveMongoInputFormat$MongoHiveInputSplit:Class com.mongodb.hadoop.hive.input.HiveMongoInputFormat$MongoHiveInputSplit not found
at org.apache.hadoop.hive.ql.io.HiveInputFormat$HiveInputSplit.readFields(HiveInputFormat.java:147)
at org.apache.hadoop.io.serializer.WritableSerialization$WritableDeserializer.deserialize(WritableSerialization.java:71)
at org.apache.hadoop.io.serializer.WritableSerialization$WritableDeserializer.deserialize(WritableSerialization.java:42)
at org.apache.hadoop.mapred.MapTask.getSplitDetails(MapTask.java:370)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:402)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:162)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:157)
Caused by: java.lang.ClassNotFoundException: Class com.mongodb.hadoop.hive.input.HiveMongoInputFormat$MongoHiveInputSplit not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:1626)
at org.apache.hadoop.hive.ql.io.HiveInputFormat$HiveInputSplit.readFields(HiveInputFormat.java:144)
... 10 more
Container killed by the ApplicationMaster.
Please advice.
You also need to add mongo-hadoop-* and well as mongo driver jars to MR1/MR2 classpath on all workers