Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

getting failed to invoke @OnScheduled method while querydatabasetable processor

Solved Go to solution

getting failed to invoke @OnScheduled method while querydatabasetable processor

New Contributor

I am new to NIFI, and getting following error while I am trying to access Teradata database(production environment) using

querydatabasetable processor from Nifi. I have tried telnet command to teradata port 1025 from command line and its connecting.

2017-12-07 17:00:11,753 ERROR [StandardProcessScheduler Thread-4] o.a.n.p.standard.QueryDatabaseTable QueryDatabaseTable[id=2f70c1e5-0160-1000-0000-0000077bf1a3] QueryDatabaseTable[id=2f70c1e5-0160-1000-0000-0000077bf1a3] failed to invoke @OnScheduled method due to java.lang.RuntimeException: Failed while executing one of processor's OnScheduled task.; processor will not be scheduled to run for 30 seconds: java.lang.RuntimeException: Failed while executing one of processor's OnScheduled task.
2017-12-07 17:00:11,761 ERROR [StandardProcessScheduler Thread-8] org.apache.nifi.engine.FlowEngine A flow controller task execution stopped abnormally
java.util.concurrent.ExecutionException: java.lang.reflect.InvocationTargetException
at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[na:1.8.0_77]
at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[na:1.8.0_77]
at org.apache.nifi.engine.FlowEngine.afterExecute(FlowEngine.java:100) ~[na:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1150) [na:1.8.0_77]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_77]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_77]
Caused by: java.lang.reflect.InvocationTargetException: null
at sun.reflect.GeneratedMethodAccessor558.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_77]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_77]
at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:137) ~[na:na]
at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:125) ~[na:na]
at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:70) ~[na:na]
at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotation(ReflectionUtils.java:47) ~[na:na]
at org.apache.nifi.controller.StandardProcessorNode$1$1.call(StandardProcessorNode.java:1244) ~[na:na]
at org.apache.nifi.controller.StandardProcessorNode$1$1.call(StandardProcessorNode.java:1240) ~[na:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_77]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[na:1.8.0_77]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[na:1.8.0_77]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_77]
... 2 common frames omitted
Caused by: org.apache.nifi.processor.exception.ProcessException: Unable to communicate with database in order to determine column types
at org.apache.nifi.processors.standard.AbstractDatabaseFetchProcessor.setup(AbstractDatabaseFetchProcessor.java:189) ~[na:na]
at org.apache.nifi.processors.standard.QueryDatabaseTable.setup(QueryDatabaseTable.java:164) ~[na:na]
... 15 common frames omitted
Caused by: java.sql.SQLException: [Teradata Database] [TeraJDBC 16.00.00.23] [Error 3807] [SQLState 42S02] Object 'DIM_PROD' does not exist.
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDatabaseSQLException(ErrorFactory.java:309) ~[terajdbc4.jar:16.00.00.23]
at com.teradata.jdbc.jdbc_4.statemachine.ReceiveInitSubState.action(ReceiveInitSubState.java:103) ~[terajdbc4.jar:16.00.00.23]
at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.subStateMachine(StatementReceiveState.java:311) ~[terajdbc4.jar:16.00.00.23]
at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:200) ~[terajdbc4.jar:16.00.00.23]
at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:137) ~[terajdbc4.jar:16.00.00.23]
at com.teradata.jdbc.jdbc_4.statemachine.StatementController.run(StatementController.java:128) ~[terajdbc4.jar:16.00.00.23]
at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:389) ~[terajdbc4.jar:16.00.00.23]
at com.teradata.jdbc.jdbc_4.TDStatement.executeStatement(TDStatement.java:331) ~[terajdbc4.jar:16.00.00.23]
at com.teradata.jdbc.jdbc_4.TDStatement.doNonPrepExecuteQuery(TDStatement.java:319) ~[terajdbc4.jar:16.00.00.23]
at com.teradata.jdbc.jdbc_4.TDStatement.executeQuery(TDStatement.java:1121) ~[terajdbc4.jar:16.00.00.23]
at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208) ~[na:na]
at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208) ~[na:na]
at org.apache.nifi.processors.standard.AbstractDatabaseFetchProcessor.setup(AbstractDatabaseFetchProcessor.java:173) ~[na:na]
... 16 common frames omitted

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: getting failed to invoke @OnScheduled method while querydatabasetable processor

Super Guru

@Umer Umer

As per your logs

Caused by: java.sql.SQLException: [Teradata Database] [TeraJDBC 16.00.00.23] [Error 3807] [SQLState 42S02] Object 'DIM_PROD' does not exist.

dim_prod does not exist make sure you are connecting to right database.

In your JDBC connection string in connection pool, if you have mentioned database name then check the table dim_prod exists in that database.

Sample Teradata JDBC connection string:-

42979-teradata-connectionpool.png

Make sure you are having the below jars in your nifi lib path.

  • tdgssconfig.jar
  • teradata-connector-1.5.1-hadoop2.jar
  • terajdbc4.jar
  • hortonworks-teradata-connector-1.5.1.2.5.0.0-1245.jar

Teradata Connection Pool Configs:-

42978-teradata-connectionpool.png

If above jars not in nifi lib path then you need to give path to all those jars with comma separated list.

Database Driver Location(s)Comma-separated list of files/folders and/or URLs containing the driver JAR and its dependencies (if any). For example '/var/tmp/mariadb-java-client-1.1.7.jar'
Supports Expression Language: true

For both cases

Database Driver Class Name property should be

com.teradata.jdbc.TeraDriver

View solution in original post

3 REPLIES 3
Highlighted

Re: getting failed to invoke @OnScheduled method while querydatabasetable processor

Super Guru

@Umer Umer

As per your logs

Caused by: java.sql.SQLException: [Teradata Database] [TeraJDBC 16.00.00.23] [Error 3807] [SQLState 42S02] Object 'DIM_PROD' does not exist.

dim_prod does not exist make sure you are connecting to right database.

In your JDBC connection string in connection pool, if you have mentioned database name then check the table dim_prod exists in that database.

Sample Teradata JDBC connection string:-

42979-teradata-connectionpool.png

Make sure you are having the below jars in your nifi lib path.

  • tdgssconfig.jar
  • teradata-connector-1.5.1-hadoop2.jar
  • terajdbc4.jar
  • hortonworks-teradata-connector-1.5.1.2.5.0.0-1245.jar

Teradata Connection Pool Configs:-

42978-teradata-connectionpool.png

If above jars not in nifi lib path then you need to give path to all those jars with comma separated list.

Database Driver Location(s)Comma-separated list of files/folders and/or URLs containing the driver JAR and its dependencies (if any). For example '/var/tmp/mariadb-java-client-1.1.7.jar'
Supports Expression Language: true

For both cases

Database Driver Class Name property should be

com.teradata.jdbc.TeraDriver

View solution in original post

Highlighted

Re: getting failed to invoke @OnScheduled method while querydatabasetable processor

New Contributor

@Shu

thanks, I was missing "/database" in connection URL.

Highlighted

Re: getting failed to invoke @OnScheduled method while querydatabasetable processor

Iam new to NIFI i want to sqoop the data from Mysql to Hive,and i am using HDP 2.6,I have configured QueryDatabasetable Processor with DBCP and enable the same but when iam trying to start the processor i could see the below error.Please help me out.

67540-capture.png


1.png2.png
Don't have an account?
Coming from Hortonworks? Activate your account here