dear Hibernate team,
For me SchemaExport does only work when the compiled model classes are in CLASSPATH. If they aren't, then i get the following message (both in Ant and from command line)
Code:
D:\javalib\hibernate-2.1\bin>SchemaExport.bat
19.02.2004 22:30:47 net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.1.2
19.02.2004 22:30:47 net.sf.hibernate.cfg.Environment <clinit>
INFO: loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=com.mysql.jdbc.Driver, hi
bernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=net.sf.hibernate.cache.HashtableCacheProvide
r, hibernate.cache.use_query_cache=true, hibernate.max_fetch_depth=1, hibernate.dialect=net.sf.hibernate.dialect.MySQLDi
alect, hibernate.jdbc.use_streams_for_binary=true, hibernate.jdbc.batch_size=0, hibernate.query.substitutions=true 1, fa
lse 0, yes 'Y', no 'N', hibernate.proxool.pool_alias=pool1, hibernate.connection.username=sa, hibernate.connection.url=j
dbc:mysql:///fewsim, hibernate.connection.password=, hibernate.connection.pool_size=1}
19.02.2004 22:30:47 net.sf.hibernate.cfg.Environment <clinit>
INFO: using java.io streams to persist binary types
19.02.2004 22:30:47 net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
19.02.2004 22:30:47 net.sf.hibernate.cfg.Configuration addFile
INFO: Mapping file: D:\few\src\com\mcm\simweb\model\Task.hbm.xml
19.02.2004 22:30:47 net.sf.hibernate.cfg.Configuration add
SCHWERWIEGEND: Could not compile the mapping document
net.sf.hibernate.MappingException: persistent class [com.mcm.simweb.model.Task] not found
at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:84)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:221)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1229)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:171)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.main(SchemaExport.java:289)
Caused by: java.lang.ClassNotFoundException: com.mcm.simweb.model.Task
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at net.sf.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:86)
at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:81)
It's not a huge problem due to the availabilty of the code generation tool, but i have the feeling that this is unwanted behavior. Am i right? if so, i would like to ask for suggestions what to do to fix the problem. I assume it's not a bug but a config problem on my part. However, I have used the standard hibernate properties that came with hibernate 2.1 (with comments set to mysql)
thanks and kind regards,
Joe