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

flyway cannot find thin oracle driver in native mode #28915

Closed
maxandersen opened this issue Oct 29, 2022 · 4 comments · Fixed by #28921
Closed

flyway cannot find thin oracle driver in native mode #28915

maxandersen opened this issue Oct 29, 2022 · 4 comments · Fixed by #28921
Assignees
Labels
area/tracing kind/bug Something isn't working
Milestone

Comments

@maxandersen
Copy link
Member

Describe the bug

reported by mail by @chrisruffalo, See reproducer at https://github.com/chrisruffalo/quarkus-native-oracle-otel-reproducer

Quarkus / Oracle / Flyway / Otel Issue Reproducer

Requirements

  • Docker (or working devservices with podman)
  • Quarkus 2.13.3
  • JDK 17
  • GraalVM for native compile

Testing

Running the application in dev mode with mvn clean quarkus:dev -Dquarkus.profile=oracle or
mvn clean quarkus:dev -Dquarkus.profile=oracle-otel will work and all connections will be made
using dev services and the schema will be imported.

Compile to native with mvn clean package -Pnative -Dquarkus.profile=native-oracle and it will fail to start with
the following exception because it cannot connect to a database (expected):

2022-10-28 17:01:02,075 WARN  [io.agr.pool] (agroal-11) Datasource 'named': IO Error: The Network Adapter could not establish the connection (CONNECTION_ID=hwUSh4nLSKW9fB0N75Xdjw==)
2022-10-28 17:01:02,078 ERROR [io.qua.run.Application] (main) Failed to start application (with profile native-oracle): java.net.ConnectException: Connection refused
        at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VA_LIST_ConnectException_constructor_026ed3e065cc052585fca43de83265b2d1381f28(JNIJavaCallWrappers.java:0)
        at sun.nio.ch.Net.connect0(Net.java)
        at sun.nio.ch.Net.connect(Net.java:579)
        at sun.nio.ch.Net.connect(Net.java:586)
        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:853)
        at java.nio.channels.SocketChannel.open(SocketChannel.java:285)
        at oracle.net.nt.TimeoutSocketChannel.connect(TimeoutSocketChannel.java:184)
        at oracle.net.nt.TimeoutSocketChannel.<init>(TimeoutSocketChannel.java:158)
        at oracle.net.nt.TcpNTAdapter.establishSocket(TcpNTAdapter.java:381)
        at oracle.net.nt.TcpNTAdapter.doLocalDNSLookupConnect(TcpNTAdapter.java:304)
        at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:266)
        at oracle.net.nt.ConnOption.connect(ConnOption.java:238)
        at oracle.net.nt.ConnStrategy.executeConnOption(ConnStrategy.java:967)
        at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:648)
        at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:569)
        at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:933)
        at oracle.net.ns.NSProtocol.connect(NSProtocol.java:346)
        at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:2558)
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:667)
        at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:1089)
        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:90)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:733)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:649)
        at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:226)
        at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:535)
        at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:516)
        at java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:75)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.lang.Thread.run(Thread.java:833)
        at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:705)
        at com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:202)

Compile to native with mvn clean package -Pnative -Dquarkus.profile=native-oracle-otel and it will fail to start
but the exception will be that it cannot find the driver (not expected):

2022-10-28 17:05:19,359 WARN  [io.agr.pool] (agroal-11) Datasource 'named': Driver does not support the provided URL: jdbc:oracle:thin:@localhost:1521/named
2022-10-28 17:05:19,362 ERROR [io.qua.run.Application] (main) Failed to start application (with profile native-oracle-otel): java.sql.SQLException: Driver does not support the provided URL: jdbc:oracle:thin:@localhost:1521/named
        at io.agroal.pool.ConnectionFactory.connectionSetup(ConnectionFactory.java:242)
        at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:226)
        at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:535)
        at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:516)
        at java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:75)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.lang.Thread.run(Thread.java:833)
        at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:705)
        at com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:202)

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@maxandersen maxandersen added the kind/bug Something isn't working label Oct 29, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 29, 2022

/cc @cristhiank, @gastaldi, @geoand, @gsmet

@chrisruffalo
Copy link

chrisruffalo commented Oct 29, 2022

I should’ve added it to this reproducer but postgresql works fine. If I get a chance I will add it.

@michalvavrik
Copy link
Member

michalvavrik commented Oct 29, 2022

@chrisruffalo Your reproducer is very fine (apart of typo in jdbc-url -> jdbc.url), IMHO it's absolutely clear were the issue is (even if the PR I added wasn't accepted, it still proves where the problem is) and you don't need to bother with PostgreSQL. Thanks for reporting the issue.

@michalvavrik
Copy link
Member

michalvavrik commented Nov 2, 2022

@chrisruffalo I almost forgot, you can work around the issue by registering OracleDriver with DriverManager at runtime till this is fixed in Quarkus.

michalvavrik added a commit to michalvavrik/quarkus that referenced this issue Nov 3, 2022
michalvavrik added a commit to michalvavrik/quarkus that referenced this issue Nov 3, 2022
michalvavrik added a commit to michalvavrik/quarkus that referenced this issue Nov 3, 2022
michalvavrik added a commit to michalvavrik/quarkus that referenced this issue Nov 3, 2022
michalvavrik added a commit to michalvavrik/quarkus that referenced this issue Nov 4, 2022
michalvavrik added a commit to michalvavrik/quarkus that referenced this issue Nov 4, 2022
michalvavrik added a commit to michalvavrik/quarkus that referenced this issue Nov 6, 2022
michalvavrik added a commit to michalvavrik/quarkus that referenced this issue Nov 15, 2022
@brunobat brunobat moved this from Todo to In Progress in Quarkus Roadmap/Planning Dec 20, 2022
@github-project-automation github-project-automation bot moved this from In Progress to Done in Quarkus Roadmap/Planning Jan 19, 2023
@quarkus-bot quarkus-bot bot added this to the 2.17 - main milestone Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tracing kind/bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants