-->
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: hbm2ddl problem
PostPosted: Sun May 09, 2004 7:24 pm 
Beginner
Beginner

Joined: Sun May 09, 2004 7:18 pm
Posts: 35
I am a new user of hibernate. I tried the airline examples in the middlegen-hibernate-r4. Everything works fine until I did hbm2ddl part. It throws the exception that it can't fine:
net.sf.hibernate.util.ReflectHelper.getBulkBean

Anybody has any idea?

thanx.

Ping


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 13, 2004 5:53 am 
Senior
Senior

Joined: Fri Nov 21, 2003 5:55 am
Posts: 155
Please give more logs and details.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 25, 2004 5:54 pm 
Beginner
Beginner

Joined: Sun May 09, 2004 7:18 pm
Posts: 35
Hi,

Sorry for late reply.

I was using the examples in hibernate-middlegen-r4 that have 3 tables: person, airline, reservation. I have generated the hbm files and class files. I used the following bat file to generte the ddl file.
@echo off

rem -------------------------------------------------------------------
rem Execute SchemaExport tool
rem -------------------------------------------------------------------

set JDBC_DRIVER=C:\middlegen\middlegen-hibernate-r4\lib\mysql-connector-java-3.0.11-stable-bin.jar
set HIBERNATE_HOME=c:\hibernate-2.1
set LIB=%HIBERNATE_HOME%\lib
set PROPS=%HIBERNATE_HOME%\src
set CP=c:\middlegen\middlegen-hibernate-r4\build\classes;%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.jar;%LIB%\commons-logging-1.0.3.jar;%LIB%\commons-collections-2.1.jar;%LIB%\commons-lang-1.0.1.jar;%LIB%\cglib-2.0-rc2.jar;%LIB%\dom4j-1.4.jar;%LIB%\odmg-3.0.jar;%LIB%\xml-apis.jar;%LIB%\xerces-2.4.0.jar;%LIB%\xalan-2.4.0.jar;.

java -cp %CP%;LIB net.sf.hibernate.tool.hbm2ddl.SchemaExport --output=my_schema.ddl *.xml


It gave the following messages:
May 25, 2004 2:41:59 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.1.3
May 25, 2004 2:41:59 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: loaded properties from resource hibernate.properties: {hibernate.connectio
n.driver_class=com.mysql.jdbc.Driver, hibernate.cglib.use_reflection_optimizer=t
rue, 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, h
ibernate.jdbc.batch_size=0, hibernate.query.substitutions=true 1, false 0, yes '
Y', no 'N', hibernate.proxool.pool_alias=pool1, hibernate.connection.username=ro
ot, hibernate.cache.region_prefix=hibernate.test, hibernate.connection.url=jdbc:
mysql://localhost:3306/airline, hibernate.show_sql=true, hibernate.connection.pa
ssword=root, hibernate.connection.pool_size=1}
May 25, 2004 2:41:59 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: using java.io streams to persist binary types
May 25, 2004 2:41:59 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
May 25, 2004 2:41:59 PM net.sf.hibernate.cfg.Configuration addFile
INFO: Mapping file: Flight.hbm.xml
May 25, 2004 2:42:00 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: airline.hibernate.Flight -> flights
May 25, 2004 2:42:00 PM net.sf.hibernate.cfg.Configuration addFile
INFO: Mapping file: Person.hbm.xml
May 25, 2004 2:42:00 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: airline.hibernate.Person -> persons
May 25, 2004 2:42:00 PM net.sf.hibernate.cfg.Configuration addFile
INFO: Mapping file: Reservation.hbm.xml
May 25, 2004 2:42:00 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: airline.hibernate.Reservation -> reservations
Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/cglib/beans/Bu
lkBeanException
at net.sf.hibernate.util.ReflectHelper.getBulkBean(ReflectHelper.java:17
0)
at net.sf.hibernate.type.ComponentType.<init>(ComponentType.java:110)
at net.sf.hibernate.cfg.Binder.bindComponent(Binder.java:899)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:287)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243)
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
)


Any idea or suggestion?

thanx.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 04, 2004 12:52 pm 
Newbie

Joined: Tue May 25, 2004 3:22 pm
Posts: 18
....
Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/cglib/beans/Bu
lkBeanException
at net.sf.hibernate.util.ReflectHelper.getBulkBean(ReflectHelper.java:17
.....

You obviously don't hav CGLIB library (cglib-full-2.0.1.jar or something like that) in your lib directory.. It comes with Hibernate 2.1 zip, add it to your classpath.


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.