-->
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.  [ 3 posts ] 
Author Message
 Post subject: does SchemaExport rely on model classes or not?
PostPosted: Thu Feb 19, 2004 5:37 pm 
Newbie

Joined: Thu Feb 19, 2004 3:32 pm
Posts: 2
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 19, 2004 6:52 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This is perfectly expected. the generator tools need the .class files to find default types by introspection

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 19, 2004 8:29 pm 
Newbie

Joined: Thu Feb 19, 2004 3:32 pm
Posts: 2
oh, i see, the default types
- thanks for your answer!

Joe


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