-->
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.  [ 9 posts ] 
Author Message
 Post subject: SchemaExport: class not found
PostPosted: Thu Dec 23, 2004 8:08 am 
Beginner
Beginner

Joined: Thu Sep 02, 2004 9:17 am
Posts: 21
Hi

when I run the SchemaExport.bat file, I get errors about persistent class not found. Fair enough - but how do I tell SchemaExport where my class files are (is there a configuration parameter for this path)?

Thanks,
Peter


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 23, 2004 11:34 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
CLASSPATH comes to mind ,)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 27, 2004 5:46 am 
Beginner
Beginner

Joined: Thu Sep 02, 2004 9:17 am
Posts: 21
Er, ja, CLASSPATH - thanks! Feel a bit silly not to think of the most obvious path when dealing with Java...

One thing though, if I include a "jar" of my classes in the classpath, then I get a null pointer exception when I run SchemaExport - I need to include a path which includes the actual classes.

Peter


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 27, 2004 7:06 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
eh no.

just need to specify the mapping files you want to run with

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 27, 2004 7:11 am 
Beginner
Beginner

Joined: Thu Sep 02, 2004 9:17 am
Posts: 21
Hmm. Well it definitely does not work for me when I only include the mapping file (I get the class not found exception), I need to include the class files too. I am using Hibernate 2.1.6 by the way (if that has any bearing on this).

(Sjovt - kan se du bor i Danmark).


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 27, 2004 9:47 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you ofcourse need to specify your classes location via CLASSPATH and then specify the hbm.xml files on the command line to do this stuff.


(ja, Danmark er stedet ,)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 06, 2005 12:43 pm 
Newbie

Joined: Thu Jan 06, 2005 11:56 am
Posts: 10
I am using the schemaexport ant task and it also cannot find the bean class files - I get error:
C:\build.xml:220: Schema text failed:
net.sf.hibernate.MappingException: persistent class
[store.model.team.Person] not found

I wish the schemaexport ant task allowed specifing the classpath.

Below is the fragment from my ant file.

Code:
<target name="exportmodeltoDB" depends="" description="exports the model to DB using Hibernate's schemaexport" unless="Hibernate.properties">
        <path id="path.models">
            <fileset dir="out/testmodels/team">
                <include name="**/store/model/team/*.class"/>
            </fileset>
        </path>

        <taskdef name="schemaexport"
                 classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask"
            classpathref="path.models"/>

        <schemaexport properties="Hibernate.properties"
                      quiet="no" text="no" drop="no" delimiter=";">
            <fileset dir="out/testmodels/team">
                <include name="**/store/model/team/*.hbm.xml"/>
            </fileset>
        </schemaexport>
    </target>


Top
 Profile  
 
 Post subject: Found the problem - hibernate2.jar in my ant/lib directory
PostPosted: Thu Jan 06, 2005 1:01 pm 
Newbie

Joined: Thu Jan 06, 2005 11:56 am
Posts: 10
Not sure why hibernate2.jar in the ant/lib directory would cause this to fail but I am just happy it is working now that I explicitly make all the jars available from the ant classpath.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 06, 2005 4:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
never put stuff in ant/lib - its an ANTi-pattern that prevents classloading to work.

_________________
Max
Don't forget to rate


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