confluentinc / kafka-connect-jdbc

Kafka Connect connector for JDBC-compatible databases
Other
19 stars 956 forks source link

Classname "io.confluent.connect.jdbc.JdbcSourceConnector" is not defined #301

Open PiotrBB opened 6 years ago

PiotrBB commented 6 years ago

Hello,

This is more of a question. I'm trying to create jdbc oracle connector. Upon creating new one with Connect UI i got the following error: Classname "io.confluent.connect.jdbc.JdbcSourceConnector" is not defined

Here's my connector:

name=source-oracle-test
connector.class=io.confluent.connect.jdbc.JdbcSourceConnector
tasks.max=1
connection.password=PASSWORD
connection.url=jdbc:oracle:thin:@oraclehost:1572/SERVICE
connection.user=USER
table.whitelist=TABLE
mode=timestamp
timestamp.column.name=TRANSACTIONDATE
topic.prefix=source-oracle-test

I run it using /bin/connect-standalone /etc/schema-registry/connect-avro-standalone.properties /etc/kafka-connect-jdbc/source-oracle-test.properties here's log's tail

[2017-10-27 02:43:48,238] INFO Kafka Connect starting (org.apache.kafka.connect.runtime.Connect:49)
[2017-10-27 02:43:48,238] INFO Herder starting (org.apache.kafka.connect.runtime.standalone.StandaloneHerder:70)
[2017-10-27 02:43:48,238] INFO Worker starting (org.apache.kafka.connect.runtime.Worker:144)
[2017-10-27 02:43:48,239] INFO Starting FileOffsetBackingStore with file /tmp/connect.offsets (org.apache.kafka.connect.storage.FileOffsetBackingStore:59)
[2017-10-27 02:43:48,241] INFO Worker started (org.apache.kafka.connect.runtime.Worker:149)
[2017-10-27 02:43:48,241] INFO Herder started (org.apache.kafka.connect.runtime.standalone.StandaloneHerder:72)
[2017-10-27 02:43:48,241] INFO Starting REST server (org.apache.kafka.connect.runtime.rest.RestServer:98)
[2017-10-27 02:43:48,328] INFO jetty-9.2.15.v20160210 (org.eclipse.jetty.server.Server:327)
Oct 27, 2017 2:43:48 AM org.glassfish.jersey.internal.Errors logErrors
WARNING: The following warnings have been detected: WARNING: The (sub)resource method createConnector in org.apache.kafka.connect.runtime.rest.resources.ConnectorsResource contains empty path annotation.
WARNING: The (sub)resource method listConnectors in org.apache.kafka.connect.runtime.rest.resources.ConnectorsResource contains empty path annotation.
WARNING: The (sub)resource method listConnectorPlugins in org.apache.kafka.connect.runtime.rest.resources.ConnectorPluginsResource contains empty path annotation.
WARNING: The (sub)resource method serverInfo in org.apache.kafka.connect.runtime.rest.resources.RootResource contains empty path annotation.

[2017-10-27 02:43:48,838] INFO Started o.e.j.s.ServletContextHandler@590ed7c8{/,null,AVAILABLE} (org.eclipse.jetty.server.handler.ContextHandler:744)
[2017-10-27 02:43:48,852] INFO Started ServerConnector@2989fe87{HTTP/1.1}{0.0.0.0:8083} (org.eclipse.jetty.server.ServerConnector:266)
[2017-10-27 02:43:48,854] INFO Started @20053ms (org.eclipse.jetty.server.Server:379)
[2017-10-27 02:43:48,855] INFO REST server listening at http://127.0.0.1:8083/, advertising URL http://127.0.0.1:8083/ (org.apache.kafka.connect.runtime.rest.RestServer:150)
[2017-10-27 02:43:48,855] INFO Kafka Connect started (org.apache.kafka.connect.runtime.Connect:55)

I have tried to launch it via oracle-test.properties and CLI. No error occurs, it says that Kafka Connect has started, but there's no data processed. Any ideas how to handle this?

rhauch commented 6 years ago

I just downloaded and installed CP 3.3.0, cd-ed into the installation directory, added a etc/kafka-connect-jdbc/source-oracle-test.properties file with the contents you listed above, and then ran:

bin/connect-standalone etc/schema-registry/connect-avro-standalone.properties /etc/kafka-connect-jdbc/source-oracle-test.properties

I get the following in the log:

...
[2017-11-09 09:12:11,139] INFO Kafka Connect started (org.apache.kafka.connect.runtime.Connect:55)
[2017-11-09 09:12:11,190] ERROR Failed to create job for etc/kafka-connect-jdbc/source-oracle-test.properties (org.apache.kafka.connect.cli.ConnectStandalone:89)
[2017-11-09 09:12:11,190] ERROR Stopping after connector error (org.apache.kafka.connect.cli.ConnectStandalone:100)
java.util.concurrent.ExecutionException: org.apache.kafka.connect.runtime.rest.errors.BadRequestException: Connector configuration is invalid and contains the following 2 error(s):
Invalid value java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@oraclehost:1572/SERVICE for configuration Couldn't open connection to jdbc:oracle:thin:@oraclehost:1572/SERVICE
Invalid value java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@oraclehost:1572/SERVICE for configuration Couldn't open connection to jdbc:oracle:thin:@oraclehost:1572/SERVICE
You can also find the above list of errors at the endpoint `/{connectorType}/config/validate`
    at org.apache.kafka.connect.util.ConvertingFutureCallback.result(ConvertingFutureCallback.java:79)
    at org.apache.kafka.connect.util.ConvertingFutureCallback.get(ConvertingFutureCallback.java:66)
    at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:97)
Caused by: org.apache.kafka.connect.runtime.rest.errors.BadRequestException: Connector configuration is invalid and contains the following 2 error(s):
Invalid value java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@oraclehost:1572/SERVICE for configuration Couldn't open connection to jdbc:oracle:thin:@oraclehost:1572/SERVICE
Invalid value java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@oraclehost:1572/SERVICE for configuration Couldn't open connection to jdbc:oracle:thin:@oraclehost:1572/SERVICE
You can also find the above list of errors at the endpoint `/{connectorType}/config/validate`
    at org.apache.kafka.connect.runtime.AbstractHerder.maybeAddConfigErrors(AbstractHerder.java:370)
    at org.apache.kafka.connect.runtime.standalone.StandaloneHerder.putConnectorConfig(StandaloneHerder.java:157)
    at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:94)
[2017-11-09 09:12:11,191] INFO Kafka Connect stopping (org.apache.kafka.connect.runtime.Connect:65)
...

I wonder if you've not properly installed the JDBC connector into your Connect installation, either via classpath or plugin.path mechanism.

PiotrBB commented 6 years ago

When i tried to launch my oracle connector at first. i got an error that there is no suitable driver found, same as you. So i downloaded ojdbc8.jar and placed it in /usr/share/java/kafka-connect-jdbc/. Mentioned error no longer occurrs but still the connector does not work. Instead, upon running the connector i got Timeout 500 error.