Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalStateException caused by incorrect JDBC URL format in example.env #244

Open
jdaguilar opened this issue Jan 8, 2025 · 0 comments

Comments

@jdaguilar
Copy link

When I run the command:

make job

or

docker compose exec jobmanager ./bin/flink run -py /opt/src/job/start_job.py --pyFiles /opt/src -d

The application fails to start due to an IllegalStateException

Caused by: java.lang.IllegalStateException: Could not find any jdbc dialect factory that can handle url '"jdbc:postgresql://host.docker.internal:5432/postgres"' that implements 'org.apache.flink.connector.jdbc.dialect.JdbcDialectFactory' in the classpath.

Available factories are:

org.apache.flink.connector.jdbc.dialect.derby.DerbyDialectFactory
org.apache.flink.connector.jdbc.dialect.mysql.MySqlDialectFactory
org.apache.flink.connector.jdbc.dialect.oracle.OracleDialectFactory
org.apache.flink.connector.jdbc.dialect.psql.PostgresDialectFactory
        at org.apache.flink.connector.jdbc.dialect.JdbcDialectLoader.load(JdbcDialectLoader.java:64)
        at org.apache.flink.connector.jdbc.table.JdbcDynamicTableFactory.validateConfigOptions(JdbcDynamicTableFactory.java:270)
        at org.apache.flink.connector.jdbc.table.JdbcDynamicTableFactory.createDynamicTableSink(JdbcDynamicTableFactory.java:90)
        at org.apache.flink.table.factories.FactoryUtil.createDynamicTableSink(FactoryUtil.java:267)
        ... 29 more

The issue is caused by an incorrect JDBC URL format in the example.env file. The error message indicates that the URL is not recognized by the JdbcDialectLoader.

Probably extra double quotes around the POSTGRES_URL value in the example.env file it's the problem. Whe I remove the double quotes like this:

...
POSTGRES_URL=jdbc:postgresql://host.docker.internal:5432/postgres
JDBC_BASE_URL=jdbc:postgresql://host.docker.internal:5432

The issue is solved. So I suggest to update the example.env file to prevent this issue in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant