• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

HibernateException Pls Help

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Driver class should be mentioned where you are going to

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

amir
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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



The jar containing this driver class should be in the classpath of your application.
 
jaya lakshmi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jaya,

If you use SQLServer,
Use the below jar files

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

OK.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic