3

I am getting the famous "ora-01882: TimeZone Region not found" while using Kafka connect.

I am using ojdbc8.jar.

In the past when I had that in my Java program that I launch with Kubernetes, I used the following appraoch in the args field of the Kubernetes config.

 args: ["-Xms2g", "-Xmx2g", "-cp", "/app/entellect-fetcher-assembly.jar", "-Doracle.jdbc.timezoneAsRegion=false", "com.elsevier.entellect.fetcher.SqlFetcher"]

Using that solved the problem.

However as I'm using the confluentic helm chart, the args is not available and therefore I resorted to use env variable (CONNECT_OPTS) described in the confluent doc https://docs.confluent.io/5.0.0-beta1/cli/command-reference/index.html :

Please see below:

     env:
        - name: CONNECT_OPTS
          value: "-Doracle.jdbc.timezoneAsRegion=false"
        - name: CONNECT_REST_ADVERTISED_HOST_NAME
          valueFrom:
            fieldRef:
              fieldPath: status.podIP
        - name: CONNECT_BOOTSTRAP_SERVERS
          value: {{ template "cp-kafka-connect.kafka.bootstrapServers" . }}
        - name: CONNECT_GROUP_ID
          value: {{ template "cp-kafka-connect.groupId" . }}

I am not successful with this.

I wonder if anyone has experienced that before and if they can share their solution. Whether it is setting the Timezone directly, or how to set what I have tried above, or changing the driver and what not.

I have tried with odjbc6.jar and it works, but I am getting some bad deserialization for some numbers. No idea why. Hence I would like to try with odjbc8.jar.

I imagine there must be some way :)

Note my config so far:

connector.class=io.confluent.connect.jdbc.JdbcSourceConnector
connection.password=***********
transforms=
table.whitelist=ACTIVITYDATA
mode=bulk
topic.prefix=pp_db_
connection.user=pharmapendium4
name=PP
numeric.mapping=best_fit
value.converter=org.apache.kafka.connect.json.JsonConverter
connection.url=jdbc:oracle:thin:@xx.x.xx.xxx:1521:pp
numeric.precision.mapping=false
key.converter=org.apache.kafka.connect.json.JsonConverter
halfer
  • 19,824
  • 17
  • 99
  • 186
MaatDeamon
  • 9,532
  • 9
  • 60
  • 127
  • What does "not successful" mean - are you still getting the ORA-01882 error, or some other error, possibly from the config? Does exactly the same config work with ojdbc6.jar, or is something else different when that works? (Also, since you mentioned setting the time zone directly, you could consider [this](https://stackoverflow.com/a/28452607/266304).) – Alex Poole Aug 14 '19 at 17:33

1 Answers1

0

You could edit the jar file: ojdbc8.jar.

Namely defaultConnectionProperties.properties, which can be found at path: ojdbc8.jar\oracle\jdbc.

There you would add a line:

oracle.jdbc.timezoneAsRegion=false

tukan
  • 17,050
  • 1
  • 20
  • 48