-->
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.  [ 1 post ] 
Author Message
 Post subject: Schema text failed: Dialect class not found:
PostPosted: Sun Aug 05, 2007 3:46 pm 
Newbie

Joined: Sun Aug 05, 2007 3:28 pm
Posts: 2
Hi,
I am trying to build an application using Hibernate 2.1.8
I am using HSQLDB. while trying to generate a schema using ANT i get the following error.
build.xml:85: Schema text failed: Dialect class not found: net.sf.hibernate.dialect.HSQLDialect
I have hibernate2.jar in the classpath, but i still get this error.

Hibernate version:Hibernate 2.1.8

build file:
<?xml version="1.0"?>
<project name="Harnessing Hibernate: The Developer's Notebook"
default="db" basedir=".">

<!-- Set up properties containing important project directories -->
<property name="source.root" value="src"/>
<property name="class.root" value="classes"/>
<property name="lib.dir" value="lib"/>
<property name="data.dir" value="data"/>

<!-- Set up the class path for compilation and execution -->
<path id="project.class.path">
<!-- Include our own classes, of course -->
<pathelement location="${class.root}" />
<!-- Include jars in the project library directory -->
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>

<target name="db" description="Runs HSQLDB database management UI
against the database file--use when application is not running">
<java classname="org.hsqldb.util.DatabaseManager"
fork="yes">
<classpath refid="project.class.path"/>
<arg value="-driver"/>
<arg value="org.hsqldb.jdbcDriver"/>
<arg value="-url"/>
<arg value="jdbc:hsqldb:${data.dir}/music"/>
<arg value="-user"/>
<arg value="sa"/>
</java>
</target>

<!-- Teach Ant how to use Hibernate's code generation tool -->
<taskdef name="hbm2java"
classname="net.sf.hibernate.tool.hbm2java.Hbm2JavaTask"
classpathref="project.class.path"/>

<!-- Generate the java code for all mapping files in our source tree -->
<target name="codegen"
description="Generate Java source from the O/R mapping files">
<hbm2java output="${source.root}">
<fileset dir="${source.root}">
<include name="**/*.hbm.xml"/>
</fileset>
</hbm2java>
</target>

<!-- Create our runtime subdirectories and copy resources into them -->
<target name="prepare" description="Sets up build structures">
<mkdir dir="${class.root}"/>

<!-- Copy our property files and O/R mappings for use at runtime -->
<copy todir="${class.root}" >
<fileset dir="${source.root}" >
<include name="**/*.properties"/>
<include name="**/*.hbm.xml"/>
</fileset>
</copy>
</target>

<!-- Compile the java source of the project -->
<target name="compile" depends="prepare"
description="Compiles all Java classes">
<javac srcdir="${source.root}"
destdir="${class.root}"
debug="on"
optimize="off"
deprecation="on">
<classpath refid="project.class.path"/>
</javac>
</target>

<!-- Generate the schemas for all mapping files in our class tree -->
<target name="schema" depends="compile"
description="Generate DB schema from the O/R mapping files">

<!-- Teach Ant how to use Hibernate's schema generation tool -->
<taskdef name="schemaexport"
classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"
classpathref="project.class.path"/>

<schemaexport properties="${class.root}/hibernate.properties"
quiet="no" text="no" drop="no">
<fileset dir="${class.root}">
<include name="**/*.hbm.xml"/>
</fileset>
</schemaexport>
</target>

</project>




Full stack trace of any exception that occurs:
Apache Ant version 1.7.0 compiled on December 13 2006
Buildfile: build.xml
Detected Java version: 1.6 in: C:\Program Files\Java\jdk1.6.0\jre
Detected OS: Windows XP
parsing buildfile C:\HibernateDir\build.xml with URI = file:/C:/HibernateDir/bu
ld.xml
Project base dir set to: C:\HibernateDir
[antlib:org.apache.tools.ant] Could not load definitions from resource org/apac
e/tools/ant/antlib.xml. It could not be found.
Build sequence for target(s) `schema' is [prepare, compile, schema]
Complete build sequence is [prepare, compile, schema, db, codegen, ]

prepare:
[mkdir] Skipping C:\HibernateDir\classes because it already exists.
[copy] com\oreilly\hh\Track.hbm.xml omitted as C:\HibernateDir\classes\com
oreilly\hh\Track.hbm.xml is up to date.
[copy] com\oreilly\hh\hibernate.properties omitted as C:\HibernateDir\clas
es\com\oreilly\hh\hibernate.properties is up to date.
[copy] hibernate.properties omitted as C:\HibernateDir\classes\hibernate.p
operties is up to date.
[copy] No sources found.

compile:
[javac] com\oreilly\hh\Track.hbm.xml skipped - don't know how to handle it
[javac] com\oreilly\hh\Track.java omitted as C:\HibernateDir\classes\com\or
illy\hh\Track.class is up to date.
[javac] com\oreilly\hh\hibernate.properties skipped - don't know how to han
le it
[javac] hibernate.properties skipped - don't know how to handle it

schema:
[schemaexport] 12:34:15,609 INFO Environment:483 - Hibernate 2.1.8
[schemaexport] 12:34:15,625 INFO Environment:517 - loaded properties from reso
rce hibernate.properties: {hibernate.connection.username=sa , hibernate.
onnection.password=, hibernate.cglib.use_reflection_optimizer=true, hibernate.d
alect=net.sf.hibernate.dialect.HSQLDialect, hibernate.connection.url=jdbc:hsqld
:data/music , hibernate.connection.driver_class=org.hsqldb.jdbcDriver}
[schemaexport] 12:34:15,625 INFO Environment:543 - using CGLIB reflection opti
izer
[schemaexport] 12:34:15,640 INFO Environment:572 - using JDK 1.4 java.sql.Time
tamp handling
[schemaexport] 12:34:15,656 INFO Configuration:170 - Mapping file: C:\Hibernat
Dir\classes\com\oreilly\hh\Track.hbm.xml
[schemaexport] 12:34:15,921 INFO Binder:229 - Mapping class: com.oreilly.hh.Tr
ck -> TRACK

BUILD FAILED
C:\HibernateDir\build.xml:85: Schema text failed: Dialect class not found: net.
f.hibernate.dialect.HSQLDialect
at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportT
sk.java:146)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.ja
a:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultEx
cutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.Main.runBuild(Main.java:698)
at org.apache.tools.ant.Main.startAnt(Main.java:199)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: net.sf.hibernate.HibernateException: Dialect class not found: net.sf
hibernate.dialect.HSQLDialect
at net.sf.hibernate.dialect.Dialect.getDialect(Dialect.java:396)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:
7)
at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.getSchemaExport(Schem
ExportTask.java:209)
at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportT
sk.java:136)
... 17 more
--- Nested Exception ---
net.sf.hibernate.HibernateException: Dialect class not found: net.sf.hibernate.
ialect.HSQLDialect
at net.sf.hibernate.dialect.Dialect.getDialect(Dialect.java:396)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:
7)
at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.getSchemaExport(Schem
ExportTask.java:209)
at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportT
sk.java:136)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.ja
a:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultEx
cutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.Main.runBuild(Main.java:698)
at org.apache.tools.ant.Main.startAnt(Main.java:199)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)


Name and version of the database you are using: HSQLDB


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

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.