-->
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.  [ 2 posts ] 
Author Message
 Post subject: Problem with Hibernate Tools
PostPosted: Fri Jan 25, 2008 12:37 am 
Newbie

Joined: Fri Jan 25, 2008 12:16 am
Posts: 7
Location: Brasil, Palmas - Tocantins
jdk1.5.0_12
jre1.5.0_12
Hibernate 3.2.2
Hibernate tools 3.2.0
Eclipse SDK
Version: 3.2.2
Build id: M20070212-1330

I have used Hibernate tool for Eclipse to generate hibernate.cfg.xml with successfull, despite that the only driver to MySQL that appear as option is org.gjt.mm.mysql.Driver, but I write manually com.mysql.jdbc.Driver. When the hibernate.cfg.xml is already generated, I go to Hibernate Code Generation option, the problem is in this step, because I'm not able to finish the process, an error occur when I click in refresh, a window "Lazy tree error" with the messages:

org.hibernate.console.HibernateConsoleRuntimeException: Problems while loading database driverclass (com.mysql.jdbc.Driver)
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

I yet add mysql-connector- java-5.0.6-bin.jar in enviroments variables and in the project and path directory but I continue receiving the errors


Top
 Profile  
 
 Post subject: Re: Problem
PostPosted: Fri Jan 25, 2008 10:04 am 
Newbie

Joined: Fri Mar 04, 2005 4:27 pm
Posts: 13
Sounds like a Class loader problem. Make sure that only one of the Driver classes is available to the application. (via jar file or whatever)

I don't know how much you know about Class loaders so bear with me here. The ClassLoader that physically loads a class is part of the class "signature" for the duration that the class is loaded. If the same class is loaded by a different ClassLoader it is completely different (signature wise) than the first one. So, if an application is looking for the second instance and can only see the first one you'll get your exception because they are different.

read this:

http://www.javaworld.com/javaworld/jw-1 ... depth.html

Hope this helps.

John G.


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