aws-samples / aws-samples/msk-connect-custom-plugin-jmx

JMXExporter fails to init

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
9
Forks
3
PR merge metrics
No merged PRs in 30d

Description

I downloaded the JAR file from the repository for Debezium version 2.7.
Running it on MSK Connect works but no metrics and JMX exporter fails due to
```python
Caused by: java.lang.ClassNotFoundException: org.apache.commons.text.StringEscapeUtils
```

I do see that the Apache Common String package is present in the pom.xml file.
It seems that the packaged JAR you uploaded is missing the dependency and it's also not available through other means.

I tested on MSK Connect v3.7.x

EDIT:
I changed the pom.xml file to also package dependencies:
```xml

4.0.0
software.amazon.msk.debezium.mysql
msk-debezium-mysql-metrics-connector
0.0.3-SNAPSHOT


3.3.2
2.7.3.Final
3.10.1
5.8.2
2.22.2
3.4.1



org.apache.kafka
connect-api
${connect.api.version}
provided


io.debezium
debezium-connector-mysql
${debezium.connector.mysql.version}


software.amazon.awssdk
cloudwatch
2.15.81


org.apache.commons
commons-text
1.10.0





src/main/resources
true




org.apache.maven.plugins
maven-compiler-plugin
${maven.compiler.plugin}
true

11



org.apache.maven.plugins
maven-shade-plugin
${maven.shade.plugin.version}


package

shade


false



software.amazon.msk.debezium.mysql.MetricsConnector







```

and also put the Apache common JARs (text and lang3) in the same folder of the final JAR before zipping them all together - just to be sure.

It worked.

Contributor guide

Open the contributing guide

Research direction

Start with the repository's pom.xml and the Maven shade-plugin configuration shown in the report. Build the release JAR, inspect whether org.apache.commons.text.StringEscapeUtils and its required Apache Commons dependencies are packaged, then verify that the downloaded artifact initializes in MSK Connect without the ClassNotFoundException and exposes metrics.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java
Domain
backend, cloud, observability-sre
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.