• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

JDBC Driver class not found:

Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i run code the, i got the following error,

[java] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
[java] log4j:WARN Please initialize the log4j system properly.
[java] Initial SessionFactory creation failed.org.hibernate.HibernateException: JDBC Driver class not found: oracle.jdbc.driver.OracleDriver
[java] java.lang.ExceptionInInitializerError
[java] at Utils.HibernateUtil.<clinit>(Unknown Source)
[java] at events.EventManager.createAndStoreEvent(Unknown Source)
[java] at events.EventManager.main(Unknown Source)
[java] Caused by: org.hibernate.HibernateException: JDBC Driver class not found: oracle.jdbc.driver.OracleDriver
[java] at org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:66)
[java] at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:80)
[java] at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:362)
[java] at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)
[java] at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
[java] ... 3 more
[java] Caused by: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
[java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
[java] at java.lang.Class.forName0(Native Method)
[java] at java.lang.Class.forName(Class.java:141)
[java] at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
[java] at org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:61)
[java] ... 8 more
[java] Exception in thread "main"
[java] Java Result: 1

Please find my configuration file below :


<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"



<!-- Database connection settings -->
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc racle:thin:@ evdb</property>
<property name="connection.username">test_admin</property>
<property name="connection.password">test_admin</property>

<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">10</property>

<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.OracleDialect</property>

<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>

<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>

<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">update</property>

<mapping resource="Event.hbm.xml"/>


Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have the Oracle driver jar in your classpath?
bala kumar
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have added classes12.zip file. Eventhough the same error comes.
    Bookmark Topic Watch Topic
  • New Topic