tlberglund / groovy-liquibase

Yet Another Groovy DSL for Liquibase
Other
85 stars 66 forks source link

oracle driver not found even though it is in classpath #23

Closed pzim closed 9 years ago

pzim commented 12 years ago

When adding a classpath dependency on the ojdbc6 jar (classpath 'com.oracle:ojdbc6:11.2.0.2.0') and running updateSQL, I'm getting the following error:

"Liquibase Update Failed: Cannot find database driver: "oracle.jdbc.OracleDriver" "

Running in debug mode, I see the ojdbc jar is in the classpath. If I run with Java (taking gradle out of the picture), it finds the driver but fails trying to parse the changelog.groovy file. Running within gradle seems to be having some kind of issue with the lifecycle related to the oracle driver.

tlberglund commented 12 years ago

I think this issue belongs in https://github.com/tlberglund/gradle-liquibase-plugin, not in the DSL project. I plan to try to repro today, but could you create this issue in that project so I can address it there? I'll close this one out after you do.

pzim commented 12 years ago

Hi Tim,

Interestingly, the gradle liquibase plugin doesn't have this issue. It resolves the Oracle driver successfully. I only see this issue in liquibase.gradle when using the groovy dsl version. Hope that helps.

Thanks, Phil On Dec 9, 2011 4:00 AM, "Tim Berglund" < reply@reply.github.com> wrote:

I think this issue belongs in https://github.com/tlberglund/gradle-liquibase-plugin, not in the DSL project. I plan to try to repro today, but could you create this issue in that project so I can address it there? I'll close this one out after you do.


Reply to this email directly or view it on GitHub:

https://github.com/tlberglund/groovy-liquibase/issues/23#issuecomment-3077672

pzim commented 12 years ago

Hey Tim,

Let me know if I'm off-base on this one, as I may not completely understand the relationship between the two projects. I would really like to get the groovy-liquibase version working, as most of our liquibase projects are writing their changelog files in groovy dsl syntax.

Anyway, let me know what you think and we can go from there.

Thanks, -Phil

On Fri, Dec 9, 2011 at 6:15 AM, Phil Zimmerman pzimmerman.home@gmail.comwrote:

Hi Tim,

Interestingly, the gradle liquibase plugin doesn't have this issue. It resolves the Oracle driver successfully. I only see this issue in liquibase.gradle when using the groovy dsl version. Hope that helps.

Thanks, Phil On Dec 9, 2011 4:00 AM, "Tim Berglund" < reply@reply.github.com> wrote:

I think this issue belongs in https://github.com/tlberglund/gradle-liquibase-plugin, not in the DSL project. I plan to try to repro today, but could you create this issue in that project so I can address it there? I'll close this one out after you do.


Reply to this email directly or view it on GitHub:

https://github.com/tlberglund/groovy-liquibase/issues/23#issuecomment-3077672

jclawson commented 12 years ago

Phil,

I found it easier for my situation to simply modify the gradle script to include the oracle jar. I commented out the mysql jar dependency inclusion and added:

runtime 'com.oracle:ojdbc6:11.2.0.2.0'

Note: we run our own nexus server and uploaded this oracle jar to it. I don't think the latest oracle driver jar is in central. So, I also modified the gradle script to use our repository instead of central.

pzim commented 12 years ago

Hi Jason,

I appreciate the note. I actually tried that very same thing prior to entering the issue. We use artifactory online and the oracle jar resolves fine, but for some odd reason, it is not happy. I can see it in the classpath here:

13:31:10.794 [DEBUG] [org.gradle.process.internal.ProcessBuilderFactory] with argument#1 = /opt/build/scm/scripts/buildServer/groovy/bin/build/classes/main:/opt/build/scm/scripts/buildServer/groovy/bin/build/resources/main:/home/pzimmerman/.gradle/caches/artifacts-4/org.codehaus.groovy/groovy/66173b2828535c787c2f4dbc44f90ae3/jars/groovy-1.7.5.jar:/home/pzimmerman/.gradle/caches/artifacts-4/org.liquibase/liquibase-core/66173b2828535c787c2f4dbc44f90ae3/jars/liquibase-core-2.0.1.jar:/home/pzimmerman/.gradle/caches/artifacts-4/com.oracle/ojdbc6/66173b2828535c787c2f4dbc44f90ae3/jars/ojdbc6-11.2.0.2.0.jar

But it's still failing like so:

13:31:11.293 [QUIET] [system.out] Liquibase Update Failed: Cannot find database driver: "oracle.jdbc.OracleDriver" 13:31:11.311 [ERROR] [system.err] SEVERE 12/16/11 1:31 PM:liquibase: Cannot find database driver: "oracle.jdbc.OracleDriver" 13:31:11.312 [QUIET] [system.out] 13:31:11.313 [ERROR] [system.err] liquibase.exception.DatabaseException: java.lang.RuntimeException: Cannot find database driver: "oracle.jdbc.OracleDriver"

stevesaliman commented 9 years ago

Closing, since this is over 3 years old with no activity, and the DSL has been pretty much completely rewritten since this issue was first reported.