-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Schema Export Problem w/ Build Script
PostPosted: Sat Aug 28, 2004 12:54 pm 
Regular
Regular

Joined: Thu Aug 05, 2004 11:15 pm
Posts: 50
I have a folder called practice2 that is in the hibernate-2.1 folder. In the folder I havea Collection.java class, a Collection.hbm.xml file, among other .java files. I believe the files work because if I manually create the tables, I can like store info into the tables.

My problem is trying to create a table using the scema export tool. It seems to not create a table and gives an error message too.

My hibernate.properties file is in the hibernate-2.1/src folder. My database is MySQL.


So here is my build script:


<project name="kenny" default="compile" basedir=".">
<property name="src" value="."/>
<property name="build" value="build"/>

<target name="init">
<mkdir dir="${build}"/>
</target>

<target name="compile" depends="init">
<!-- Compile the java code -->
<javac srcdir="${src}" destdir="${build}"/>
</target>




<!-- from an Ant build.xml -->
<target name="init-db">
<taskdef classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask" classpathref="project.class.path" name="schemaexport"/>
<schemaexport delimiter=";" drop="false" output="schema.sql" properties="config/hibernate.properties" quiet="false" text="false">
<fileset dir="${build.destdir}">
<include name="**/*.hbm.xml"/>
</fileset>
</schemaexport>
</target>


<target
name="create-tables"
depends="init-db"
description="Create tables"
>
<echo>Creating tables using URL ${database.url}</echo>
<sql
classpath="${database.driver.classpath}"
driver="${database.driver}"
url="${database.url}"
userid="${database.userid}"
password="${database.password}"
src="${database.script.file}"
print="true"
output="result.txt"
/>
</target>

</project>




When I type 'ant' into the command line when I am in the practice2 folder, I get the error message: 'Content is not allowed in prolog.'

Does anyone know what the problem is? All I am aiming for at this point is to create a table using schema export. So if anyone who got the schema export tool working could look over my build script and give some pointers, that would be appreciated.

Thank you,
Mush


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 28, 2004 1:38 pm 
Regular
Regular

Joined: Thu Aug 05, 2004 11:15 pm
Posts: 50
Actually I got it to not say: 'Content is not allowed in prolog.'
anymore, with same build file. It says 'build successful' but no table is created. Any suggestions concerning my build file on creating a table?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.