Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JDBC Driver class not found:

bala kumar
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 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(
[java] at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(
[java] at org.hibernate.cfg.SettingsFactory.createConnectionProvider(
[java] at org.hibernate.cfg.SettingsFactory.buildSettings(
[java] at org.hibernate.cfg.Configuration.buildSettings(
[java] at org.hibernate.cfg.Configuration.buildSessionFactory(
[java] ... 3 more
[java] Caused by: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
[java] at$
[java] at Method)
[java] at
[java] at java.lang.ClassLoader.loadClass(
[java] at sun.misc.Launcher$AppClassLoader.loadClass(
[java] at java.lang.ClassLoader.loadClass(
[java] at java.lang.ClassLoader.loadClassInternal(
[java] at java.lang.Class.forName0(Native Method)
[java] at java.lang.Class.forName(
[java] at org.hibernate.util.ReflectHelper.classForName(
[java] at org.hibernate.connection.DriverManagerConnectionProvider.configure(
[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="">update</property>

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


Paul Sturrock
Posts: 10336
Eclipse IDE Hibernate 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 file. Eventhough the same error comes.
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!