db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thillerson <tony.hiller...@effectiveui.com>
Subject java.net.MalformedURLException while writing Schema
Date Tue, 08 Aug 2006 23:41:13 GMT

Hello,

I just ran accross dbutils today and I'm glad to find something at least
approacing rails migrations (not nearly, but getting close, I guess) in the
java world where I need to spend my days.

I have a very simple problem - I get a java.net.MalformedURLException when
trying to dump the schema from an existing mysql db. The data will get
written, but the schema will not.

Here's my build file's relevant parts: 
	<target name="db-structure-dump" description="Dumps the database structure"
depends="init">
		<databaseToDdl>
			<database url="${datasource.url}"
driverClassName="${datasource.driverClassName}"
username="${datasource.username}" password="${datasource.password}" />
			<!--<writeSchemaSqlToFile alterDatabase="false"
outputFile="database.ddl"/>-->
			<!--<writeDtdToFile outputFile="schema.dtd"/>-->
			<writeSchemaToFile outputFile="${build.dir}/schema.xml"/>
		</databaseToDdl>
	</target>
	
	<target name="db-dump" description="Dumps the database structure"
depends="init">
		<databaseToDdl>
			<database url="${datasource.url}"
driverClassName="${datasource.driverClassName}"
username="${datasource.username}" password="${datasource.password}" />
			<writeDataToFile outputFile="${build.dir}/data.xml"/>
		</databaseToDdl>
	</target>
	
And here's the output of an `ant -v db-structure-dump`:

C:\work\mcc\trunk\mcc-data>ant -v db-structure-dump
Apache Ant version 1.6.5 compiled on June 2 2005
Buildfile: build.xml
Detected Java version: 1.5 in: C:\java\jre
Detected OS: Windows XP
parsing buildfile C:\work\mcc\trunk\mcc-data\build.xml with URI =
file:///C:/wor
k/mcc/trunk/mcc-data/build.xml
Project base dir set to: C:\work\mcc\trunk\mcc-data
 [property] Loading C:\work\mcc\trunk\mcc-data\jdbc.properties.mysql
Build sequence for target(s) `db-structure-dump' is [init,
db-structure-dump]
Complete build sequence is [init, db-structure-dump, db-load, db-dump, ]

init:
     [echo] Using Database at jdbc:mysql://127.0.0.1/mcc

db-structure-dump:

BUILD FAILED
C:\work\mcc\trunk\mcc-data\build.xml:40: Failed to write to output file
C:\work\
mcc\trunk\mcc-data\target\schema.xml
        at
org.apache.ddlutils.task.WriteSchemaToFileCommand.execute(WriteSchema
ToFileCommand.java:82)
        at
org.apache.ddlutils.task.DatabaseTaskBase.executeCommands(DatabaseTas
kBase.java:240)
        at
org.apache.ddlutils.task.DatabaseTaskBase.execute(DatabaseTaskBase.ja
va:264)
        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: org.apache.ddlutils.DdlUtilsException:
java.net.MalformedURLException

        at org.apache.ddlutils.io.DatabaseIO.write(DatabaseIO.java:299)
        at
org.apache.ddlutils.task.WriteSchemaToFileCommand.execute(WriteSchema
ToFileCommand.java:76)
        ... 14 more
Caused by: java.net.MalformedURLException
        at java.net.URL.<init>(Unknown Source)
        at java.net.URL.<init>(Unknown Source)
        at java.net.URL.<init>(Unknown Source)
        at
org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown So
urce)
        at
org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown
 Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.commons.digester.Digester.parse(Digester.java:1647)
        at
org.apache.commons.betwixt.XMLIntrospector.loadMultiMapping(XMLIntros
pector.java:657)
        at
org.apache.commons.betwixt.XMLIntrospector.register(XMLIntrospector.j
ava:627)
        at org.apache.ddlutils.io.DatabaseIO.getWriter(DatabaseIO.java:135)
        at org.apache.ddlutils.io.DatabaseIO.write(DatabaseIO.java:295)
        ... 15 more
--- Nested Exception ---
org.apache.ddlutils.DdlUtilsException: java.net.MalformedURLException
        at org.apache.ddlutils.io.DatabaseIO.write(DatabaseIO.java:299)
        at
org.apache.ddlutils.task.WriteSchemaToFileCommand.execute(WriteSchema
ToFileCommand.java:76)
        at
org.apache.ddlutils.task.DatabaseTaskBase.executeCommands(DatabaseTas
kBase.java:240)
        at
org.apache.ddlutils.task.DatabaseTaskBase.execute(DatabaseTaskBase.ja
va:264)
        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at org.apache.tools.ant.Target.performTasks(Target.java:369)
        at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:40)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.net.MalformedURLException
        at java.net.URL.<init>(Unknown Source)
        at java.net.URL.<init>(Unknown Source)
        at java.net.URL.<init>(Unknown Source)
        at
org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown So
urce)
        at
org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown
 Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.commons.digester.Digester.parse(Digester.java:1647)
        at
org.apache.commons.betwixt.XMLIntrospector.loadMultiMapping(XMLIntros
pector.java:657)
        at
org.apache.commons.betwixt.XMLIntrospector.register(XMLIntrospector.j
ava:627)
        at org.apache.ddlutils.io.DatabaseIO.getWriter(DatabaseIO.java:135)
        at org.apache.ddlutils.io.DatabaseIO.write(DatabaseIO.java:295)
        ... 15 more

Total time: 2 seconds

The problem is not that I didn't create the build.dir, and it also happens
if I put the output file in the root of the project. As I said, the
writeSchemaSqlToFile and writeDataToFile tasks work fine.

Any ideas what's going on?
-- 
View this message in context: http://www.nabble.com/java.net.MalformedURLException-while-writing-Schema-tf2075920.html#a5717307
Sent from the Apache DdlUtils - User forum at Nabble.com.


Mime
View raw message