Unable to register the MBean

1,892 views
Skip to first unread message

FairyTail1279

unread,
Apr 9, 2022, 8:48:36 AM4/9/22
to debezium
Hi All. 
I am getting below error when I create and reconfig debezium connector to add table.

[2565-04-09 18:59:42,515] INFO WorkerSourceTask{id=test-pipe-ora-hr-cust_source_cdc-0} flushing 0 outstanding messages for offset commit (org.apache.kafka.connect.runtime.WorkerSourceTask:487)
[2565-04-09 18:59:42,518] ERROR WorkerSourceTask{id=test-pipe-ora-hr-cust_source_cdc-0} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask:184)
java.lang.RuntimeException: Unable to register the MBean 'debezium.oracle:type=connector-metrics,context=schema-history,server=test-pipe-ora-hr-cust'
    at io.debezium.metrics.Metrics.register(Metrics.java:77)
    at io.debezium.relational.history.DatabaseHistoryMetrics.started(DatabaseHistoryMetrics.java:95)
    at io.debezium.relational.history.AbstractDatabaseHistory.start(AbstractDatabaseHistory.java:82)
    at io.debezium.relational.history.KafkaDatabaseHistory.start(KafkaDatabaseHistory.java:261)
    at io.debezium.relational.HistorizedRelationalDatabaseSchema.<init>(HistorizedRelationalDatabaseSchema.java:42)
    at io.debezium.connector.oracle.OracleDatabaseSchema.<init>(OracleDatabaseSchema.java:38)
    at io.debezium.connector.oracle.OracleConnectorTask.start(OracleConnectorTask.java:63)
    at io.debezium.connector.common.BaseSourceTask.start(BaseSourceTask.java:130)
    at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:224)
    at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:182)
    at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:231)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: javax.management.InstanceAlreadyExistsException: debezium.oracle:type=connector-metrics,context=schema-history,server=test-pipe-ora-hr-cust
    at java.management/com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:436)
    at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1855)
    at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:955)
    at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:890)
    at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:320)
    at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
    at io.debezium.metrics.Metrics.register(Metrics.java:73)
    ... 15 more
[2565-04-09 18:59:42,520] INFO Stopping down connector (io.debezium.connector.common.BaseSourceTask:238)
[2565-04-09 18:59:42,577] INFO Connection gracefully closed (io.debezium.jdbc.JdbcConnection:956)
[2565-04-09 18:59:42,578] WARN Could not stop task (org.apache.kafka.connect.runtime.WorkerSourceTask:171)
java.lang.NullPointerException
    at io.debezium.connector.oracle.OracleConnectorTask.doStop(OracleConnectorTask.java:140)
    at io.debezium.connector.common.BaseSourceTask.stop(BaseSourceTask.java:252)
    at io.debezium.connector.common.BaseSourceTask.stop(BaseSourceTask.java:222)
    at org.apache.kafka.connect.runtime.WorkerSourceTask.close(WorkerSourceTask.java:169)
    at org.apache.kafka.connect.runtime.WorkerTask.doClose(WorkerTask.java:161)
    at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:187)
    at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:231)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
[2565-04-09 18:59:42,601] INFO [Producer clientId=connector-producer-test-pipe-ora-hr-cust_source_cdc-0] Closing the Kafka producer with timeoutMillis = 30000 ms. (org.apache.kafka.clients.producer.KafkaProducer:1204)
[2565-04-09 18:59:42,621] INFO Metrics scheduler closed (org.apache.kafka.common.metrics.Metrics:659)

Thanks.
FairyTail

Chris Cranford

unread,
Apr 11, 2022, 8:43:40 AM4/11/22
to debe...@googlegroups.com, FairyTail1279
Hi Fairy -

There are two things here that I think are a bit important.

First, the "Unable to register the MBean" is a normal error that happens if you either start a second connector using the same "database.server.name".  This configuration option should always be unique across connectors and any re-use will cause this exception to occur.  However, there is also some corner cases where Kafka Connect may not gracefully stop the previous connector instance & starts a new one after a re-balance prematurely.  If that ever happens, then you can also face this error as well, as its informing you that the previous instance is still running and has not yet completely stopped.  You would need to look closely at the Kafka Connect logs to understand why.

Second, the "NullPointerException" should not have happened, the code should have been resilient enough to avoid that.  I've opened DBZ-4978 [1] to track this problem.

Thanks,
Chris

[1]: https://issues.redhat.com/browse/DBZ-4978
--
You received this message because you are subscribed to the Google Groups "debezium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debezium+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/debezium/f3b00d48-33cb-4fa5-b44e-c69d3ae7e002n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages