My Oracle Support Banner

java.lang.NoClassDefFoundError When Placing JDBC Driver or Application-Dependent JARs in <DOMAIN_HOME>/lib Directory (Doc ID 1328300.1)

Last updated on NOVEMBER 13, 2018

Applies to:

Oracle Weblogic Server - Version: 10.3.3 to 10.3.5
Information in this document applies to any platform.


When initializing application (during deployment phase) or modules like JDBC Datasource, the following error occurs (in this example, it is a database connection initialization of an application using Hibernate that was failing):

Caused by: java.lang.NoClassDefFoundError: com/mypackage/MyClass
at weblogic.jdbc.wrapper.DatabaseMetaData_com_mypackage_MyClass.getDatabaseProductName(Unknown Source)
at org.hibernate.cfg.SettingsFactory.buildSettings(
at org.hibernate.cfg.Configuration.buildSettings(
at org.hibernate.cfg.Configuration.buildSessionFactory(
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory (
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory (
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet (
at (
at (

The same "NoClassDefFoundError" can occur while initializing applications (other than database/datasource) when those applications are dependent on external jar files that are added to the <DOMAIN_HOME>\lib directory.

Steps to reproduce the issue:

  1. Have database server running.
  2. Remove the database driver from the WLS installation (WL_HOME/server/lib).
  3. Place the driver jar in <MyDomain>/lib directory.
  4. Start the servers.
  5. Create a datasource.
  6. Access to the datasource from an application.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.