-->
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.  [ 4 posts ] 
Author Message
 Post subject: Schema export problems
PostPosted: Fri Jul 16, 2004 2:34 am 
Newbie

Joined: Fri Jul 16, 2004 2:18 am
Posts: 5
Hi I am trying to use the schema export tool to create the ddl scripts for my MYSQL Database. However each time I run my Ant file I get the following stack trace:

Code:
schemaexport:
[schemaexport] (cfg.Environment                     462 ) Hibernate 2.1.4
[schemaexport] (cfg.Environment                     496 ) loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=com.mysql.jdbc.Driver, hibernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=net.sf.ehcache.hibernate.Provider, hibernate.cache.use_query_cache=true, hibernate.max_fetch_depth=1, hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.jdbc.batch_size=0,hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.proxool.pool_alias=pool1, hibernate.connection.username=root, hibernate.cache.region_prefix=hibernate.test, hibernate.connection.url=jdbc:mysql:///test, hibernate.show_sql=true, hibernate.connection.password=, hibernate.connection.pool_size=1}
[schemaexport] (cfg.Environment                     521 ) using java.io streamsto persist binary types
[schemaexport] (cfg.Environment                     522 ) using CGLIB reflection optimizer
[schemaexport] (cfg.Configuration                   166 ) Mapping file: C:\java\classes\medical\busobj\Activation.hbm.xml
[schemaexport] (cfg.Configuration                   252 ) Could not compile the mapping document
[schemaexport] net.sf.hibernate.MappingException: persistent class [medical.busobj.Activation] not found
[schemaexport]  at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:84)
[schemaexport]  at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:221)
[schemaexport]  at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243)
[schemaexport]  at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
[schemaexport]  at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:171)
[schemaexport]  at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.getConfiguration(SchemaExportTask.java:195)
[schemaexport]  at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:135)
[schemaexport]  at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306)
[schemaexport]  at org.apache.tools.ant.Task.perform(Task.java:401)
[schemaexport]  at org.apache.tools.ant.Target.execute(Target.java:338)
[schemaexport]  at org.apache.tools.ant.Target.performTasks(Target.java:365)
[schemaexport]  at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
[schemaexport]  at org.apache.tools.ant.Project.executeTargets(Project.java:1094)
[schemaexport]  at org.apache.tools.ant.Main.runBuild(Main.java:669)
[schemaexport]  at org.apache.tools.ant.Main.startAnt(Main.java:220)
[schemaexport]  at org.apache.tools.ant.launch.Launcher.run(Launcher.java:215)
[schemaexport]  at org.apache.tools.ant.launch.Launcher.main(Launcher.java:90)
[schemaexport] Caused by: java.lang.ClassNotFoundException: medical.busobj.Activation
[schemaexport]  at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
[schemaexport]  at java.security.AccessController.doPrivileged(Native Method)
[schemaexport]  at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
[schemaexport]  at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
[schemaexport]  at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
[schemaexport]  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
[schemaexport]  at java.lang.Class.forName0(Native Method)
[schemaexport]  at java.lang.Class.forName(Class.java:141)
[schemaexport]  at net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:102)
[schemaexport]  at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:81)
[schemaexport]  ... 16 more
[schemaexport] (cfg.Configuration                   175 ) Could not configure datastore from file: C:\java\classes\medical\busobj\Activation.hbm.xml
[schemaexport] net.sf.hibernate.MappingException: persistent class [medical.busobj.Activation] not found
[schemaexport]  at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:84)
[schemaexport]  at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:221)
[schemaexport]  at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243)
[schemaexport]  at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
[schemaexport]  at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:171)
[schemaexport]  at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.getConfiguration(SchemaExportTask.java:195)
[schemaexport]  at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:135)
[schemaexport]  at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306)
[schemaexport]  at org.apache.tools.ant.Task.perform(Task.java:401)
[schemaexport]  at org.apache.tools.ant.Target.execute(Target.java:338)
[schemaexport]  at org.apache.tools.ant.Target.performTasks(Target.java:365)
[schemaexport]  at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
[schemaexport]  at org.apache.tools.ant.Project.executeTargets(Project.java:1094)
[schemaexport]  at org.apache.tools.ant.Main.runBuild(Main.java:669)
[schemaexport]  at org.apache.tools.ant.Main.startAnt(Main.java:220)
[schemaexport]  at org.apache.tools.ant.launch.Launcher.run(Launcher.java:215)
[schemaexport]  at org.apache.tools.ant.launch.Launcher.main(Launcher.java:90)
[schemaexport] Caused by: java.lang.ClassNotFoundException: medical.busobj.Activation
[schemaexport]  at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
[schemaexport]  at java.security.AccessController.doPrivileged(Native Method)
[schemaexport]  at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
[schemaexport]  at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
[schemaexport]  at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
[schemaexport]  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
[schemaexport]  at java.lang.Class.forName0(Native Method)
[schemaexport]  at java.lang.Class.forName(Class.java:141)
[schemaexport]  at net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:102)
[schemaexport]  at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:81)
[schemaexport]


Now I get that it cant for some reason find the class files but I dont know why when the files are there and compiled.

The build task I am using is as below:
Code:
<target name="schemaexport">
       <taskdef name="schemaexport"
           classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"
           classpathref="project.class.path"/>   
       <schemaexport
           properties="hibernate.properties"
           quiet="no"
           text="no"
           drop="no"
           delimiter=";"
           output="schema-export.sql">
           <fileset dir="classes">
                  <include name="**/*.hbm.xml"/>
           </fileset>
       </schemaexport>
    </target>


Directory structure is like below:
Code:
classes.dir
    medical.dir
        busobj.dir (this is where the class files go along with copys of the mapping files)
lib.dir
src.dir
   medical.dir
       busobj.dir (this is where the source files and mapping files are located)
build.xml
hibernate.properties


Any help provided woudl be much appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 20, 2004 9:29 am 
Senior
Senior

Joined: Tue Nov 25, 2003 9:35 am
Posts: 194
Location: San Francisco
schemaexport needs the .class files of the POJOs in the taskdef classpath.

What does project.class.path contain?

Sherman


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 13, 2004 2:44 am 
Newbie

Joined: Fri Jul 16, 2004 2:18 am
Posts: 5
Sorry I took so long getting back to you. I finally figured out the problem a couple of weeks ago there was one tiny mistake in the build file which resulted in the class files not being placed in the path properly got that fixed and its all good.

Thanx for the help.

- Aaron


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 25, 2004 8:15 pm 
Regular
Regular

Joined: Thu Aug 05, 2004 11:15 pm
Posts: 50
what was the mistake? I would like to know because I am encpuntering same problem


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