aspose file tools*
The moose likes Object Relational Mapping and the fly likes HibernateException Pls Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "HibernateException Pls Help" Watch "HibernateException Pls Help" New topic
Author

HibernateException Pls Help

jaya lakshmi
Greenhorn

Joined: Mar 04, 2005
Posts: 10
Hi,

Am using Netbeans 5.5 with hibernate 3.05 plugin. with HibernateToolSuite.
I ve included all jar files mentioned in the site. In the Session Factory configuration i ve given
MySQLDialect and DatabaseDriver as org.gjt.mm.mysql.Driver.
When i select open/reload command it throws an exception
org.hibernate.HibernateException: JDBC Driver class not found: org.gjt.mm.mysql.Driver
at org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:66)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:366)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)
at net.java.dev.hts.SessionFactoryDescriptor.openSession(SessionFactoryDescriptor.java:471)
at net.java.dev.hts.SessionFactoryDescriptor.access$000(SessionFactoryDescriptor.java:54)
at net.java.dev.hts.SessionFactoryDescriptor$1.run(SessionFactoryDescriptor.java:413)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:932)
Caused by: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.netbeans.ProxyClassLoader.loadInOrder(ProxyClassLoader.java:582)
at org.netbeans.ProxyClassLoader.smartLoadClass(ProxyClassLoader.java:531)
at org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:163)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
at org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:61)



Pls help me where i need to mention the driver classed for databases.
Amirtharaj Chinnaraj
Ranch Hand

Joined: Sep 28, 2006
Posts: 236
Driver class should be mentioned where you are going to

configure a session-factory(i.e) in cfg.xml or in hibernate.properties

amir
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10213
    
166

Caused by: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver


The jar containing this driver class should be in the classpath of your application.


[My Blog] [JavaRanch Journal]
jaya lakshmi
Greenhorn

Joined: Mar 04, 2005
Posts: 10
Thanks for your replies it works with hibernate.properties.

It is working perfectly for MySQL. But for SQLServer it is throwing ClassNotfoundException com.microsoft.jdbc.sqlserver.SQLServerDriver
I ve included mssqlserver.jar in lib folder of classpath.

What do i do...
Edward Durai
Ranch Hand

Joined: Oct 09, 2004
Posts: 223
Hi Jaya,

If you use SQLServer,
Use the below jar files

1. msbase.jar
2. mssqlserver.jar
3. msutil.jar

OK.


Thank You<br />Edward
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HibernateException Pls Help