Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-41841

Liquibase runner pipeline support for Oracle engine

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      In liquibase-runner-plugin there is no support for Oracle database engine. When I set databaseEngine: 'Oracle' it tries to use H2 default driver for that connection. Also following this documentation there is no support for Oracle: https://github.com/jenkinsci/liquibase-runner-plugin/blob/develop/src/docs/pipeline.md. Is is possible to add such a functionality in liquibase pipeline?

        Attachments

          Issue Links

            Activity

            Hide
            prospero238 Keith Collison added a comment -

            Unfortunately, due to licensing restrictions, the plugin cannot include the Oracle JDBC Driver.

            You may, however, use the classpath and driverClassname configuration fields to accommodate Oracle, provided the jdbc driver is located on the build machine:

            1. Define the classpath to point to the Oracle driver jdbc jar file.
            2. Define the driverClassname to be "oracle.jdbc.driver.OracleDriver" (or whatever the Oracle driver classname is).

            For example:

            node {
              liquibaseUpdate(changeLogFile: 'changeset.xml',
                      classpath: "path/to/oracle/jdbc/driver.jar",
                      driverClassname: 'oracle.jdbc.driver.OracleDriver'
              )
            }
            
            Show
            prospero238 Keith Collison added a comment - Unfortunately, due to licensing restrictions, the plugin cannot include the Oracle JDBC Driver. You may, however, use the classpath and driverClassname configuration fields to accommodate Oracle, provided the jdbc driver is located on the build machine: Define the classpath to point to the Oracle driver jdbc jar file. Define the driverClassname to be "oracle.jdbc.driver.OracleDriver" (or whatever the Oracle driver classname is). For example: node { liquibaseUpdate(changeLogFile: 'changeset.xml' , classpath: "path/to/oracle/jdbc/driver.jar" , driverClassname: 'oracle.jdbc.driver.OracleDriver' ) }
            Hide
            piotrminkowski Piotr Minkowski added a comment -

            I tried to set that configuration:

            liquibaseUpdate changeLogFile: 'src/main/script/changelog-master.xml', url: 'jdbc:oracle:thin:@10.10.99.9:1521:PSDB', credentialsId: 'BSA_PREPROD', classpath: "/home/cicdadm/ojdbc7-12.1.0.1.jar", driverClassname: 'oracle.jdbc.driver.OracleDriver'
            

            And I get following exception:

            java.lang.RuntimeException: Error registering database driver oracle.jdbc.driver.OracleDriver
            at org.jenkinsci.plugins.liquibase.evaluator.AbstractLiquibaseBuilder.createJdbcConnection(AbstractLiquibaseBuilder.java:243)
            at org.jenkinsci.plugins.liquibase.evaluator.AbstractLiquibaseBuilder.createLiquibase(AbstractLiquibaseBuilder.java:164)
            at org.jenkinsci.plugins.liquibase.evaluator.AbstractLiquibaseBuilder.perform(AbstractLiquibaseBuilder.java:129)
            at org.jenkinsci.plugins.liquibase.workflow.LiquibaseUpdateExecution.run(LiquibaseUpdateExecution.java:45)
            at org.jenkinsci.plugins.liquibase.workflow.LiquibaseUpdateExecution.run(LiquibaseUpdateExecution.java:15)
            at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40)
            at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:184)
            at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126)
            at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:109)
            at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1280)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1174)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812)
            at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:46)
            at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1280)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1174)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
            at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
            at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:16)
            at WorkflowScript.run(WorkflowScript:15)
            at __cps.transform__(Native Method)
            at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:48)
            at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
            at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
            at sun.reflect.GeneratedMethodAccessor542.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
            at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
            at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
            at sun.reflect.GeneratedMethodAccessor539.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
            at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
            at com.cloudbees.groovy.cps.Next.step(Next.java:58)
            at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
            at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:163)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:324)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:78)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:236)
            at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:224)
            at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:63)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
            at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
            at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
            Caused by: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
            at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:348)
            at org.jenkinsci.plugins.liquibase.common.Util.registerDatabaseDriver(Util.java:55)
            at org.jenkinsci.plugins.liquibase.evaluator.AbstractLiquibaseBuilder.createJdbcConnection(AbstractLiquibaseBuilder.java:230)
            at org.jenkinsci.plugins.liquibase.evaluator.AbstractLiquibaseBuilder.createLiquibase(AbstractLiquibaseBuilder.java:164)
            at org.jenkinsci.plugins.liquibase.evaluator.AbstractLiquibaseBuilder.perform(AbstractLiquibaseBuilder.java:129)
            at org.jenkinsci.plugins.liquibase.workflow.LiquibaseUpdateExecution.run(LiquibaseUpdateExecution.java:45)
            at org.jenkinsci.plugins.liquibase.workflow.LiquibaseUpdateExecution.run(LiquibaseUpdateExecution.java:15)
            at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40)
            at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:184)
            at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126)
            at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:109)
            at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1280)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1174)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812)
            at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:46)
            at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1280)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1174)
            at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
            at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
            at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:16)

            Show
            piotrminkowski Piotr Minkowski added a comment - I tried to set that configuration: liquibaseUpdate changeLogFile: 'src/main/script/changelog-master.xml' , url: 'jdbc:oracle:thin:@10.10.99.9:1521:PSDB' , credentialsId: 'BSA_PREPROD' , classpath: "/home/cicdadm/ojdbc7-12.1.0.1.jar" , driverClassname: 'oracle.jdbc.driver.OracleDriver' And I get following exception: java.lang.RuntimeException: Error registering database driver oracle.jdbc.driver.OracleDriver at org.jenkinsci.plugins.liquibase.evaluator.AbstractLiquibaseBuilder.createJdbcConnection(AbstractLiquibaseBuilder.java:243) at org.jenkinsci.plugins.liquibase.evaluator.AbstractLiquibaseBuilder.createLiquibase(AbstractLiquibaseBuilder.java:164) at org.jenkinsci.plugins.liquibase.evaluator.AbstractLiquibaseBuilder.perform(AbstractLiquibaseBuilder.java:129) at org.jenkinsci.plugins.liquibase.workflow.LiquibaseUpdateExecution.run(LiquibaseUpdateExecution.java:45) at org.jenkinsci.plugins.liquibase.workflow.LiquibaseUpdateExecution.run(LiquibaseUpdateExecution.java:15) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40) at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:184) at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:109) at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1280) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1174) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812) at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:46) at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1280) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1174) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:16) at WorkflowScript.run(WorkflowScript:15) at __ cps.transform __(Native Method) at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:48) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82) at sun.reflect.GeneratedMethodAccessor542.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55) at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45) at sun.reflect.GeneratedMethodAccessor539.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21) at com.cloudbees.groovy.cps.Next.step(Next.java:58) at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154) at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:163) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:324) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:78) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:236) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:224) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:63) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at org.jenkinsci.plugins.liquibase.common.Util.registerDatabaseDriver(Util.java:55) at org.jenkinsci.plugins.liquibase.evaluator.AbstractLiquibaseBuilder.createJdbcConnection(AbstractLiquibaseBuilder.java:230) at org.jenkinsci.plugins.liquibase.evaluator.AbstractLiquibaseBuilder.createLiquibase(AbstractLiquibaseBuilder.java:164) at org.jenkinsci.plugins.liquibase.evaluator.AbstractLiquibaseBuilder.perform(AbstractLiquibaseBuilder.java:129) at org.jenkinsci.plugins.liquibase.workflow.LiquibaseUpdateExecution.run(LiquibaseUpdateExecution.java:45) at org.jenkinsci.plugins.liquibase.workflow.LiquibaseUpdateExecution.run(LiquibaseUpdateExecution.java:15) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40) at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:184) at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:109) at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1280) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1174) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812) at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:46) at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1280) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1174) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:16)
            Hide
            mottaviani Mark Ottaviani added a comment -

            Just wanted to report that I'm seeing the same issue and error using DB2 drivers  

            Running the same commands via standard liqubase command line we have no problems.  

            Show
            mottaviani Mark Ottaviani added a comment - Just wanted to report that I'm seeing the same issue and error using DB2 drivers   Running the same commands via standard liqubase command line we have no problems.  

              People

              • Assignee:
                prospero238 Keith Collison
                Reporter:
                piotrminkowski Piotr Minkowski
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: