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.  [ 5 posts ] 
Author Message
 Post subject: SchemaExport(console) : Java.lang.noClassDefFoundError
PostPosted: Tue Jul 17, 2007 10:18 am 
Newbie

Joined: Tue Jul 17, 2007 9:52 am
Posts: 15
Bonjour,
je n'arrive pas à génerer le script de ma Bd à partir des fichier de mapping hibernate.

voici les étapes que j'ai suivi :

1- dezziper le dossier hibernate version 3.2
vers c:\hibernate-3.2

2-parametrer le fichier hibernate.properties
voici son contenu :
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class=org.postgresql.Driver
hibernate.connection.url=jdbc:postgresql:localhost:5432:ma_bd
hibernate.connection.username=mon_login
hibernate.connection.password=mon_pwd

3- creer une variable d'environnement CLASSPATH
avec le chemin des jar d'hibernate et de PostgresSQL 8.0

4- mes fichiers de mapping
sont dans le repertoire c:\hibernate-3.2\mon_mapping
(j'ai plusieurs fichiers de mapping dans ce repertaoire)

5-sur la console je tape la ligne de commande :
c:\hinernate-3.2>java org.hibernate.tool.hbm2ddl.SchematExport --text --format --properties=etc\hibernate.properties --output=ma_ddl.txt etc/mon_mapping/*.hbm.xml

6 - je recois le message d'érreur:
Exception in thread "main" Java.lang.noClassDefFoundError : org/hibernate/tool/hbm2ddl/SchemaExport

merci d'avance pour vos réponses


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 17, 2007 11:32 am 
Regular
Regular

Joined: Mon Apr 19, 2004 6:54 pm
Posts: 79
Un probleme de classpath.
Montre nous ta variable CLASSPATH.

pour les jars, il faut les citer explicitement dans ton classpath, le chemin vers les jars ne suffit pas.
si tes jars sont dans lib
CLASSPATH=lib ne suffit pas
il te faut quelque chose comme ca
CLASSPATH=lib/myjar1.jar:lib/myjar2.jar


Top
 Profile  
 
 Post subject: le contenu de ma variable CLASSPATH
PostPosted: Wed Jul 18, 2007 4:42 am 
Newbie

Joined: Tue Jul 17, 2007 9:52 am
Posts: 15
C:\hibernate-3.2\hibernate3.jar;c:\hibernate-3.2\lib\commons-logging-1.0.4.jar;c:\hibernate-3.2\lib\ehcache-1.2.3.jar;c:\hibernate-3.2\lib\cglib-2.1.3.jar;c:\hibernate-3.2\lib\jta.jar;c:\hibernate-3.2\lib\asm.jar;c:\hibernate-3.2\lib\antlr-2.7.6.jar;c:\hibernate-3.2\lib\jaxen-1.1-beta-7.jar;c:\program files\postgresql\8.0\jdbc\postgresql-8.0-310.jdbc3.jar


Top
 Profile  
 
 Post subject: SchemaExport : problèeme résolu
PostPosted: Wed Jul 18, 2007 8:49 am 
Newbie

Joined: Tue Jul 17, 2007 9:52 am
Posts: 15
Bonjour,
merci pour votre aide;
[b]en effet il a suffit que je rajoute les jar suivant à la variable CLASSPATH :[/]
c:\hibernate-3.2\lib\commons-collections-2.1.1.jar;c:\hibernate-3.2\lib\dom4j-1.6.1.jar;c:\hibernate-3.2\lib\log4j-1.4.11.jar;c:\hibernate-3.2\lib\asm-attrs.jar

merci


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 21, 2007 3:40 am 
Newbie

Joined: Sat May 26, 2007 8:18 am
Posts: 9
学习了








-------------------------------------------------------------
梦中相约的亲人,他们强化消腩丸在草原的另一端少林十三灸行走


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