• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC Driver class not found:

 
bala kumar
Greenhorn
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 :

hibernate.cfg.xml
==================

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

<hibernate-configuration>

<session-factory>

<!-- Database connection settings -->
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc racle:thin:@172.16.1.26:1521 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"/>

</session-factory>

</hibernate-configuration>
 
Paul Sturrock
Bartender
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
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have added classes12.zip file. Eventhough the same error comes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic