micronaut-projects / micronaut-data

Ahead of Time Data Repositories
Apache License 2.0
465 stars 197 forks source link

Using Oracle Autonomous DB over JDBC with generated pom.xml does not connect to DB #1413

Closed MartinBalin closed 2 years ago

MartinBalin commented 2 years ago

Expected Behavior

Create the app using micronaut.io/launch to connect to Oracle db using OJDBC driver, debug the app it will build and run the app making sure OJDBC is on classpath.

Actual Behaviour

generated pom.xml contains this:

<dependency>
      <groupId>com.oracle.database.jdbc</groupId>
      <artifactId>ojdbc8</artifactId>
      <scope>runtime</scope>
</dependency>

It connects using Wallet downloaded to localhost. run such app in VSCode Micronaut tooling and you'll get following exceptions, see attachment OJDBC8_output.txt changing OJDBC dependency to what is below, works. The app can be run and debug

<dependency>
      <groupId>com.oracle.database.jdbc</groupId>
            <artifactId>ojdbc11</artifactId>
            <version>21.5.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.oracle.database.security</groupId>
            <artifactId>oraclepki</artifactId>
            <version>21.5.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.oracle.database.security</groupId>
            <artifactId>osdt_cert</artifactId>
            <version>21.5.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.oracle.database.security</groupId>
            <artifactId>osdt_core</artifactId>
            <version>21.5.0.0</version>
        </dependency>

Attached is original pom.xml as obtained from micronaut.io/launch pom_orig.xml.txt

Dependency in pom.xml as generated is not sufficient to run the app.

Steps To Reproduce

Create project using VSCode MN Create project wizard. Check options for Oracle database and JDBC.

Environment Information

GraalVM 22.0.0.1 EE JDK11, macOS. VSCode and GraalVM Ext pack + NetBeans VSIX #13.0.982

Example Application

No response

Version

3.4.0

dstepanov commented 2 years ago

@pgressa Do we miss some libs in Micronau launch?

graemerocher commented 2 years ago

@n0tl3ss will look at this one. I think it is not an issue if you use the ATP module

MartinBalin commented 2 years ago

Confirmed, when I select Oracle ATP and MN Data JDBC it connects to Autonomous DB on OCI using Wallet. Not sure if Micronaut Data JDBC is needed in this case. I want to know this to be able to tell users how to create Micronaut App using wizard in VSCode which then can easily access Autonom DB in OCI. Seems like ATP is the way.