Error finding parent directory when using valueClobFile attribute

Hi Steve,

Sorry I forgot to specify the error message. So by simply changing the path from valueClobFile="…/customer-data/CustomerDesc.json" to valueClobFile="…/…/customer-data/CustomerDesc.json"

The following exception and error stack is thrown:

SEVERE 21/08/15 11:56:liquibase: liquibase-changelog.xml: customer-data/static_customer_data.xml::add customers::jaypal: Change Set customer-data/static_customer_data.xml::add customers::singhjp failed. Error: CLOB resource not found: …/…/customer-data/CustomerDesc.json

liquibase.exception.DatabaseException: CLOB resource not found: …/…/customer-data/CustomerDesc.json

at liquibase.statement.ExecutablePreparedStatementBase.toCharacterStream(ExecutablePreparedStatementBase.java:200)

at liquibase.statement.ExecutablePreparedStatementBase.applyColumnParameter(ExecutablePreparedStatementBase.java:125)

at liquibase.statement.ExecutablePreparedStatementBase.execute(ExecutablePreparedStatementBase.java:73)

at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:102)

at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1189)

at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1172)

at liquibase.changelog.ChangeSet.execute(ChangeSet.java:352)

at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:40)

at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:64)

at liquibase.Liquibase.update(Liquibase.java:202)

at liquibase.Liquibase.update(Liquibase.java:181)

at org.liquibase.maven.plugins.LiquibaseUpdate.doUpdate(LiquibaseUpdate.java:31)

at org.liquibase.maven.plugins.AbstractLiquibaseUpdateMojo.performLiquibaseTask(AbstractLiquibaseUpdateMojo.java:24)

at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:377)

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)

at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)

at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)

at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)

at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)

at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)

at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)

at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)

at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)

at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)

at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)

at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)

at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

I am currently using liquibase to carry out an update to an existing table in a sql database. I have included the xml script which i have written below.

The problem occurs when trying to use the valueClobFile attribute. I am trying to specify a file location in another parent directory, However the liquibase script does not like redirecting more than one parent directory up. For example in the code below the file path of valueClobFile="../customer-data/CustomerDesc.json" works perfectly.

However when trying to navigate more than one parent directory up, the file path seems to fail. e.g.

valueClobFile="../../raw-data/customer-data/CustomerDesc.json"

schema_name = 'engines'

Is there an existing bug in the code that doesn't let you reference a file path which is located more than 2 parent directories up?

When you say “seems to fail”, what do you mean? Are you getting an error message? If so, what is the message?

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Looking at the source, I don’t see any reason why this would not resolve multiple ‘parent’ directory references.

When you are executing this, what is the state of the system? Is it running from flat files, or is it running from within a jar file with resources? If it is running from a jar file with resources, are all the files referenced being stored correctly within the jar file?

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/