db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From afr0ck <afr0ck....@gmail.com>
Subject Migrate from MariaDB to Derby using DdlUtils : Ant task failure
Date Wed, 02 May 2018 20:31:10 GMT
Hello,

So i had to convert my production DB from MariaDB to Derby. I went through
the steps at  http://db.apache.org/derby/integrate/db_ddlutils.html
<http://db.apache.org/derby/integrate/db_ddlutils.html>   but i had a
problem when i run the export Ant task. 
The following text includes the environment variables i set & the failure
message from Ant alongside with the build.xml file. The database URL  is
correct & works fine in the JVM.
*
The environment variables :
*
afr0ck@afr0ck:~/Desktop/ESTORE/ddlutils$ echo $CLASSPATH 
/home/afr0ck/Desktop/ESTORE/sqlite-jdbc-3.21.0.jar:/home/afr0ck/Desktop/ESTORE/db-derby-10.14.1.0-lib/lib/derby.jar:/home/afr0ck/Desktop/ESTORE/db-derby-10.14.1.0-lib/lib/derbytools.jar:/home/afr0ck/Desktop/ESTORE/mariadb-java-client-2.2.1.jar
*
build.xml :
*
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project name=&quot;MigrateToDerby&quot; basedir=&quot;.&quot;&gt;
   &lt;path id=&quot;classpath&quot;&gt;
      &lt;fileset dir=&quot;./lib&quot;&gt;
         &lt;include name=&quot;**/*.jar&quot; /&gt;
      &lt;/fileset&gt;
   &lt;/path&gt;
   &lt;target name=&quot;export-source-db&quot; description=&quot;Dumps db
structure and data&quot;&gt;
      &lt;taskdef name=&quot;databaseToDdl&quot;
classname=&quot;org.apache.ddlutils.task.DatabaseToDdlTask&quot;&gt;
         &lt;classpath refid=&quot;classpath&quot; /&gt;
      &lt;/taskdef&gt;
      &lt;databaseToDdl modelName=&quot;MigrateTest&quot;&gt;
          &lt;database url=&quot;jdbc:mariadb://localhost:3306/estore&quot;
driverClassName=&quot;org.mariadb.jdbc.Driver&quot;
username=&quot;root&quot; password=&quot;afr0ck&quot; /&gt;
         &lt;writeSchemaToFile outputFile=&quot;db-schema.xml&quot; /&gt;
         &lt;writeDataToFile outputFile=&quot;data.xml&quot; /&gt;
      &lt;/databaseToDdl&gt;
   &lt;/target&gt;
&lt;/project&gt;

*
Ant task execution :
*
afr0ck@afr0ck:~/Desktop/ESTORE/ddlutils$ ant -v export-source-db
Apache Ant(TM) version 1.10.3 compiled on March 24 2018
Trying the default build file: build.xml
Buildfile: /home/afr0ck/Desktop/ESTORE/ddlutils/build.xml
Detected Java version: 1.8 in: /home/afr0ck/jdk1.8.0_144/jre
Detected OS: Linux
parsing buildfile /home/afr0ck/Desktop/ESTORE/ddlutils/build.xml with URI =
file:/home/afr0ck/Desktop/ESTORE/ddlutils/build.xml
Project base dir set to: /home/afr0ck/Desktop/ESTORE/ddlutils
parsing buildfile
jar:file:/usr/local/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml with
URI = jar:file:/usr/local/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml
from a zip file
Build sequence for target(s) `export-source-db' is [export-source-db]
Complete build sequence is [export-source-db, ]

export-source-db:

BUILD FAILED/home/afr0ck/Desktop/ESTORE/ddlutils/build.xml:12: Could not
read the schema from the specified database: Database type null is not
supported.
	at
org.apache.ddlutils.task.PlatformConfiguration.getPlatform(PlatformConfiguration.java:226)
	at
org.apache.ddlutils.task.DatabaseTaskBase.getPlatform(DatabaseTaskBase.java:288)
	at
org.apache.ddlutils.task.DatabaseToDdlTask.readModel(DatabaseToDdlTask.java:265)
	at
org.apache.ddlutils.task.DatabaseTaskBase.execute(DatabaseTaskBase.java:381)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:350)
	at org.apache.tools.ant.Target.execute(Target.java:448)
	at org.apache.tools.ant.Target.performTasks(Target.java:469)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1370)
	at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
	at org.apache.tools.ant.Main.runBuild(Main.java:849)
	at org.apache.tools.ant.Main.startAnt(Main.java:228)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:283)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
Caused by: java.lang.NullPointerException
	at
org.apache.ddlutils.PlatformFactory.createNewPlatformInstance(PlatformFactory.java:83)
	at
org.apache.ddlutils.task.PlatformConfiguration.getPlatform(PlatformConfiguration.java:222)
	... 20 more

Total time: 0 seconds

What could be wrong with the above configuration ?



--
Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html
Mime
View raw message