1 Reply Latest reply on Aug 10, 2019 2:28 PM by Mich Talebzadeh

    GoldenGate Big Data Error Failed to instantiate [oracle.goldengate.datasource.GGDataSource]: Factory method 'getDataSource' threw exception

    Mich Talebzadeh

      Hi,

       

      GoldenGate Version 12.3.0.1.2

       

      Trying to connect to Kafka through OGG_BD.

       

      GGSCI (rhes75) 1> info all

      Program     Status      Group       Lag at Chkpt  Time Since Chkpt

      MANAGER     RUNNING
      REPLICAT    STOPPED     RKAFKA      00:00:00      01:08:18


      ```

      GGSCI (rhes75) 2> info RKAFKA

      REPLICAT   RKAFKA    Initialized   2019-07-29 22:49   Status STOPPED
      Checkpoint Lag       00:00:00 (updated 01:08:28 ago)
      Log Read Checkpoint  File ./dirdat/rt000000000
                           First Record  RBA 0

      ```

      The log shows:

      ```

      2019-07-29T23:43:47.374+0100  WARNING OGG-00869  Oracle GoldenGate Delivery, rkafka.prm:  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userExitDataSource' defined in class path resource [oracle/goldengate/datasource/DataSource-context.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [oracle.goldengate.datasource.GGDataSource]: Factory method 'getDataSource' threw exception; nested exception is oracle.goldengate.util.ConfigException: Unable to set property on handler 'kafkahandler' (oracle.goldengate.handler.kafka.KafkaHandler). Failed to set property: topicPartitioning:="table" (class: oracle.goldengate.handler.kafka.KafkaHandler).

      2019-07-29T23:43:47.374+0100  ERROR   OGG-15051  Oracle GoldenGate Delivery, rkafka.prm:  Java or JNI exception:

                                    oracle.goldengate.util.GGException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userExitDataSource' defined in class path resource [oracle/goldengate/datasource/DataSource-context.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [oracle.goldengate.datasource.GGDataSource]: Factory method 'getDataSource' threw exception; nested exception is oracle.goldengate.util.ConfigException: Unable to set property on handler 'kafkahandler' (oracle.goldengate.handler.kafka.KafkaHandler). Failed to set property: topicPartitioning:="table" (class: oracle.goldengate.handler.kafka.KafkaHandler).

                                    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userExitDataSource' defined in class path resource [oracle/goldengate/datasource/DataSource-context.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [oracle.goldengate.datasource.GGDataSource]: Factory method 'getDataSource' threw exception; nested exception is oracle.goldengate.util.ConfigException: Unable to set property on handler 'kafkahandler' (oracle.goldengate.handler.kafka.KafkaHandler). Failed to set property: topicPartitioning:="table" (class: oracle.goldengate.handler.kafka.KafkaHandler).

                                      at oracle.goldengate.datasource.DataSourceLauncher.<init>(DataSourceLauncher.java:168)

                                      at oracle.goldengate.datasource.UserExitMain.main(UserExitMain.java:123)

                                    Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [oracle.goldengate.datasource.GGDataSource]: Factory method 'getDataSource' threw exception; nested exception is oracle.goldengate.util.ConfigException: Unable to set property on handler 'kafkahandler' (oracle.goldengate.handler.kafka.KafkaHandler). Failed to set property: topicPartitioning:="table" (class: oracle.goldengate.handler.kafka.KafkaHandler).

      2019-07-29T23:43:47.375+0100  ERROR   OGG-01668  Oracle GoldenGate Delivery, rkafka.prm:  PROCESS ABENDING.

      2019-07-29T23:43:48.885+0100  INFO    OGG-00987  Oracle GoldenGate Command Interpreter:  GGSCI command (oracle): info all.

      ...

       

      These are my 3 prm files

      ```

      cat rkafka.prm

      REPLICAT rkafka

      -- Trail file for this example is located in "AdapterExamples/trail" directory

      -- Command to add REPLICAT

      -- add replicat rkafka, exttrail AdapterExamples/trail/tr

      TARGETDB LIBFILE libggjava.so SET property=./dirprm/kafka.props

      REPORTCOUNT EVERY 1 MINUTES, RATE

      GROUPTRANSOPS 10000

      MAP scratchpad.marketdata, TARGET scratchpad.marketdata;

      ```

      ```

      cat rkafka.prm
      REPLICAT rkafka
      -- Trail file for this example is located in "AdapterExamples/trail" directory
      -- Command to add REPLICAT
      -- add replicat rkafka, exttrail AdapterExamples/trail/tr
      TARGETDB LIBFILE libggjava.so SET property=./dirprm/kafka.props
      REPORTCOUNT EVERY 1 MINUTES, RATE
      GROUPTRANSOPS 10000
      MAP scratchpad.marketdata, TARGET scratchpad.marketdata;
      oracle@rhes75:  /u01/app/oracle/product/ogg_bd/dirprm> cat kafka.props

      gg.handlerlist = kafkahandler
      gg.handler.kafkahandler.type = kafka
      gg.handler.kafkahandler.KafkaProducerConfigFile = custom_kafka_producer.properties
      #The following resolves the topic name using the short table name
      gg.handler.kafkahandler.topicMappingTemplate=marketdata
      ##gg.handler.kafkahandler.TopicName = kafkatopic
      gg.handler.kafkahandler.keyMappingTemplate=rowkey
      gg.handler.kafkahandler.format = delimitedtext
      gg.handler.kafkahandler.format.fieldDelimiter = |
      gg.handler.kafkahandler.SchemaTopicName = tpcSchemaTopic_DEV
      gg.handler.kafkahandler.BlockingSend = false
      #gg.handler.kafkahandler.includeTokens = false

      ##gg.handler.kafkahandler.mode =tx
      #gg.handler.kafkahandler.maxGroupSize =100, 1Mb
      #gg.handler.kafkahandler.minGroupSize =50, 500Kb

      gg.handler.kafkahandler.topicPartitioning = table
      gg.handler.kafkahandler.mode = op

      goldengate.userexit.timestamp=utc
      goldengate.userexit.writers=javawriter
      javawriter.stats.display=TRUE
      javawriter.stats.full=TRUE

      gg.log=log4j
      gg.log.level=trace

      gg.report.time=30sec

      gg.classpath=/u01/app/oracle/product/ogg_bd/dirprm/:/data6/hduser/kafka_2.12-1.1.0/libs/*

       

       

      #javawriter.bootoptions=-Xmx512m -Xms32m -Djava.class.path=ggjava/ggjava.jar

      ```

      ```

      cat custom_kafka_producer.properties
      ## below connects to unkerberized Kafka opensource
      bootstrap.servers=rhes75:9092, rhes75:9093, rhes75:9094, rhes564:9092, rhes564:9093, rhes564:9094, rhes76:9092, rhes76:9093, rhes76:9094
      acks=1
      compression.type=gzip
      reconnect.backoff.ms=1000

      value.serializer=org.apache.kafka.common.serialization.ByteArraySerializer
      key.serializer=org.apache.kafka.common.serialization.ByteArraySerializer
      # 100KB per partition
      batch.size=102400
      linger.ms=10000

      ```

      I have not seen this error before!

       

      Thanks