Hi all, I am using AWS Managed Apache Flink; our a...
# troubleshooting
e
Hi all, I am using AWS Managed Apache Flink; our application worked fine with the DataStream API. We wanted to test the Table API, but we’re getting this error:
Copy code
Caused by: org.apache.flink.table.api.ValidationException: Could not find any factory for identifier 'jdbc' that implements 'org.apache.flink.table.factories.DynamicTableFactory' in the classpath.
Available factory identifiers are:
blackhole
datagen
filesystem
Kafka
print
upsert-Kafka
at org.apache.flink.table.factories.FactoryUtil.discoverFactory(FactoryUtil.java:608)
at org.apache.flink.table.factories.FactoryUtil.enrichNoMatchingConnectorError(FactoryUtil.java:794)
... 37 more
I used to get this error locally, but it worked fine after manually adding the jar file for
flink-connector-jdbc
to the docker image. But I thought I wouldn’t have to do that for AWS. Have anyone worked with the Table API in AWS Managed Apache Flink?
a
Hi, error indicates that you don’t provide jdbc connector with your application code. You need to include connector jar into your application jar. You can find an example on how to configure your project build in samples repo (example).
It seems that you already providing kafka connector, do you have
flink-connector-jdbc
dependency added to your project? In your pom.xml or gradle.build, depending on how you build your application.
e
Yes it’s added in the build.graddle file, that’s what’s weird
a
Is it being included in final jar? Since you’ve mentioned that you needed to include it into your docker image - it is not. Are you adding it in the same way as kafka connector? i.e. is it being picked up by shading during build?
e
Yes both are added as in the same way
Copy code
dependencies {
    implementation 'org.apache.flink:flink-connector-kafka:3.1.0-1.18'
    implementation 'org.apache.flink:flink-connector-jdbc:3.1.2-1.18'
}
a
can you share shading configuration, if you have one?
e
Sure
Copy code
tasks {
    namedShadowJar("shadowJar") {
        exclude("org.apache.flink", "force-shading")
        exclude("com.google.code.findbugs", "jsr305")
        exclude("org.slf4j")
        exclude("org.apache.logging.log4j")
    }
}
a
I don’t see obvious issues. Could you check if your script is consistent with how gradle configuration is described in the docs? It is possible something is missing. To be able to use jdbc connector for table API you need to ensure that your jar contains: • connector classes • table factory files in
META-INF/services
e
Thanks for your help still not able to solve it though 😢