-->
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.  [ 7 posts ] 
Author Message
 Post subject: Ant build script error
PostPosted: Sat Aug 28, 2004 12:51 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?

Thank you,
Mush


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 28, 2004 12:56 pm 
Regular
Regular

Joined: Mon Feb 23, 2004 10:42 pm
Posts: 102
Location: Washington DC
This usually occurs b/c of invalid xml. It is not a Hibernate issue.

_________________
Matt Veitas


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 28, 2004 1:37 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  
 
 Post subject:
PostPosted: Sat Aug 28, 2004 1:41 pm 
Regular
Regular

Joined: Mon Feb 23, 2004 10:42 pm
Posts: 102
Location: Washington DC
Instead of using the SchemaExport tool you can use the SchemaGeneration tool. With this tool you can also get an exported version of the generated sql.

http://www.hibernate.org/hib_docs/refer ... etguide-s1

_________________
Matt Veitas


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 28, 2004 2:18 pm 
Newbie

Joined: Sat Aug 28, 2004 1:14 pm
Posts: 2
I had the same problem just a month ago. At last, I found that I had a mistake in map files, although seems be all right in running....


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 28, 2004 4:39 pm 
Regular
Regular

Joined: Thu Aug 05, 2004 11:15 pm
Posts: 50
your mistake was in the hbm.xml file?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 29, 2004 6:46 pm 
Beginner
Beginner

Joined: Wed Oct 01, 2003 3:57 am
Posts: 33
Location: Alpharetta, Georgia
I'm using UltraEdit over an SFTP connection to edit my files. Occasionally it complains about not being able to save and gives me the "retry / cancel" option. I hit the "cancel" and it saves it anyway.
Then I have the same problem you describe about prolog content.
I discover that Ultraedit has saved some binary junk at the end of the file, after the last closing tag in fact. If I add a space at the end, and save it again, the problem goes away ... eventually. See if your editor is doing something like that.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.