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

1.3.0Alpha1 cannot initially find JDBC Driver on Java8, but works on Java11 #7079

Closed
sean-scott-lr opened this issue Feb 7, 2020 · 6 comments · Fixed by #7089
Closed

1.3.0Alpha1 cannot initially find JDBC Driver on Java8, but works on Java11 #7079

sean-scott-lr opened this issue Feb 7, 2020 · 6 comments · Fixed by #7089
Labels
Milestone

Comments

@sean-scott-lr
Copy link

Describe the bug
When using 1.3.0Alpha1 with Java8, during startup I see the following error:

2020-02-07 08:14:19,867 WARN  [io.agr.pool] (Agroal_8663792271) Datasource '<default>': Unable to find a driver that accepts url: jdbc:postgresql://localhost:5432/__dbSchemaName__
2020-02-07 08:14:19,868 ERROR [io.qua.application] (main) Failed to start application: org.flywaydb.core.internal.exception.FlywaySqlException: 
Unable to obtain connection from database: Unable to find a driver that accepts url: jdbc:postgresql://localhost:5432/__dbSchemaName__
--------------------------------------------------------------------------------------------------------------------------------------
SQL State  : null
Error Code : 0
Message    : Unable to find a driver that accepts url: jdbc:postgresql://localhost:5432/__dbSchemaName__

	at org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:60)
	at org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.<init>(JdbcConnectionFactory.java:80)
	at org.flywaydb.core.Flyway.execute(Flyway.java:447)
	at org.flywaydb.core.Flyway.migrate(Flyway.java:153)
	at io.quarkus.flyway.runtime.FlywayRecorder.migrate(FlywayRecorder.java:52)
	at io.quarkus.flyway.runtime.FlywayRecorder.doStartActions(FlywayRecorder.java:35)
	at io.quarkus.deployment.steps.FlywayProcessor$configureRuntimeProperties43.deploy_0(FlywayProcessor$configureRuntimeProperties43.zig:79)
	at io.quarkus.deployment.steps.FlywayProcessor$configureRuntimeProperties43.deploy(FlywayProcessor$configureRuntimeProperties43.zig:98)
	at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:190)
	at io.quarkus.runtime.Application.start(Application.java:89)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at io.quarkus.runner.bootstrap.StartupActionImpl.run(StartupActionImpl.java:95)
	at io.quarkus.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:60)
	at io.quarkus.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:236)
	at io.quarkus.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:39)
	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:132)
	at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:86)
	at io.quarkus.dev.DevModeMain.start(DevModeMain.java:104)
	at io.quarkus.dev.DevModeMain.main(DevModeMain.java:46)
Caused by: java.sql.SQLException: Unable to find a driver that accepts url: jdbc:postgresql://localhost:5432/__dbSchemaName__
	at io.opentracing.contrib.jdbc.TracingDriver.findDriver(TracingDriver.java:132)
	at io.opentracing.contrib.jdbc.TracingDriver.connect(TracingDriver.java:68)
	at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:200)
	at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:390)
	at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:372)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:65)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

However, shortly after this error Quarkus attempts to load again and succeeds.

2020-02-07 08:14:19,909 INFO  [io.qua.dev.DevModeMain] (main) Attempting to start hot replacement endpoint to recover from previous Quarkus startup failure
2020-02-07 08:14:21,243 INFO  [io.qua.fly.FlywayProcessor] (build-22) Adding application migrations in path '/Users/sean.scott/dev/boreas/templates/quarkus-svc/src/main/g8/target/classes/db/migration/' using protocol 'file'
2020-02-07 08:14:21,244 INFO  [io.qua.fly.FlywayProcessor] (build-22) Adding application migrations in path '/Users/sean.scott/dev/boreas/templates/quarkus-svc/src/main/g8/target/classes/db/migration/' using protocol 'file'
2020-02-07 08:14:22,041 INFO  [io.qua.grpc] (vert.x-worker-thread-1) Registered gRPC service com.logrhythm.svc.__servicePackage__.v1.grpc.__serviceClass__GrpcService
2020-02-07 08:14:22,043 INFO  [io.qua.grpc] (vert.x-worker-thread-1) Registered gRPC interceptor com.logrhythm.core.quarkus.grpc.LRServerTracingInterceptor
2020-02-07 08:14:22,043 INFO  [io.qua.grpc] (vert.x-worker-thread-1) Registered gRPC interceptor com.logrhythm.core.quarkus.grpc.LRMethodInterceptor
2020-02-07 08:14:22,059 INFO  [io.qua.grpc] (vert.x-worker-thread-1) gRPC server listening on port 5050
2020-02-07 08:14:22,231 INFO  [org.fly.cor.int.dat.DatabaseFactory] (vert.x-worker-thread-1) Database: jdbc:postgresql://localhost:5432/__dbSchemaName__ (PostgreSQL 12.1)
2020-02-07 08:14:22,271 INFO  [org.fly.cor.int.com.DbMigrate] (vert.x-worker-thread-1) Current version of schema "public": 1
2020-02-07 08:14:22,272 INFO  [org.fly.cor.int.com.DbMigrate] (vert.x-worker-thread-1) Schema "public" is up to date. No migration necessary.

This does NOT happen in Java 11

Expected behavior
Error does not occur.

Actual behavior
Succeeds in Java 11, Fails in Java 8

To Reproduce
Steps to reproduce the behavior:
1.
2.
3.

Configuration

# Add your application.properties here, if applicable.

Screenshots
(If applicable, add screenshots to help explain your problem.)

Environment (please complete the following information):

  • Output of uname -a or ver: Darwin USMACEA090SSCOT 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64
  • Output of java -version: openjdk version "1.8.0_242"
    OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_242-b08)
    OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.242-b08, mixed mode)
  • GraalVM version (if different from Java):
  • Quarkus version or git rev: 1.3.0Alpha1

Additional context
(Add any other context about the problem here.)

@sean-scott-lr sean-scott-lr added the kind/bug Something isn't working label Feb 7, 2020
@jaikiran
Copy link
Member

jaikiran commented Feb 7, 2020

This looks odd:

Caused by: java.sql.SQLException: Unable to find a driver that accepts url: jdbc:postgresql://localhost:5432/__dbSchemaName__
	at io.opentracing.contrib.jdbc.TracingDriver.findDriver(TracingDriver.java:132)
	at io.opentracing.contrib.jdbc.TracingDriver.connect(TracingDriver.java:68)
	at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:200)

Not sure why it's using io.opentracing.contrib.jdbc.TracingDriver to connect. Can you share an application which reproduces this?

@sean-scott-lr
Copy link
Author

We are using the tracing driver.
quarkus.datasource.url=jdbc:tracing:postgresql://localhost:port/dbSchemaName

Works in 1.2.0.Final Java8 and Java11
Doesn't work in 1.3.0.Alpha1 Java8 but does in Java11

@aloubyansky
Copy link
Member

The issue is described launching the application in dev mode. What happens when you build it and launch it from the JAR?

@sean-scott-lr
Copy link
Author

So, I had to skip tests to build the jar because the issue happens during test too. However, I was able to run the jar with JDK8 successfully once I was able to build it.

@aloubyansky
Copy link
Member

Thanks for this info.

@jaikiran
Copy link
Member

jaikiran commented Feb 8, 2020

This is a genuine issue. I've opened #7089 with a potential fix.

@gsmet gsmet added this to the 1.3.0 milestone Feb 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants