WLS 10.3.1 - Error "unknown Oracle major version" When Using Hibernate Dialect with Oracle 11g Database (Doc ID 1155678.1)

Last updated on JUNE 09, 2016

Applies to:

Oracle WebLogic Server - Version 10.3.1 and later
Information in this document applies to any platform.

Symptoms

When attempting to use Hibernate Dialect for Oracle11g database on Weblogic 10.3.1, the following error is thrown:

2010-07-09 16:10:54,147 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] INFO org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider() - Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
2010-07-09 16:10:54,221 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] INFO org.hibernate.cfg.SettingsFactory.buildSettings() - RDBMS: Oracle, version: Oracle Database 11g Release 11.1.0.0.0 - Production
2010-07-09 16:10:54,223 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] INFO org.hibernate.cfg.SettingsFactory.buildSettings() - JDBC driver: Oracle JDBC driver, version: 10.2.0.1.0
2010-07-09 16:10:54,256 [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] ERROR org.springframework.web.context.ContextLoader.initWebApplicationContext() - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventsAppRemoteServiceImpl': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.barcap.psl.apps.events.services.EventsServicesFacade com.barcap.psl.apps.events.ui.server.EventsAppRemoteServiceImpl.eventsServicesFacade; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventsServices' defined in ServletContext resource [/WEB-INF/eventsContext.xml]: Cannot resolve reference to bean 'eventsDao' while setting bean property 'eventsDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventsDao': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory com.barcap.psl.apps.events.dao.EventsDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateSessionFactory' defined in ServletContext resource [/WEB-INF/pslCoreContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: unknown Oracle major version [11]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessAfterInstantiation(AutowiredAnnotationBeanPostProcessor.java:243)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:959)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1799)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3041)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1374)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:452)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
...


The above error persists even after the following actions are taken:

  1. The ojdbc6.jar copied to the Weblogic domain lib path
  2. Change the driver class name to be oracle.jdbc.OracleDriver
  3. Set the above jar file to the beginning of the server classpath, to be before weblogic.jar, eg:
CLASSPATH=:/home/wls103/etg/lib/ojdbc6.jar:/opt/beawls/10.3.1/wlserver_10.3/server/lib/weblogic.jar:/opt/beajrockit/1.6.0_11-b03/lib/tools.jar:/opt/beawls/10.3.1/wlserver_10.3/server/lib/ojdbc14.jar:/opt/beajrockit/1.6.0_11-
b03/jre/lib/rt.jar:/opt/beawls/10.3.1/wlserver_10.3/server/lib/webservices.jar::... ... ...


The Hibernate dialect used is org.hibernate.dialect.Oracle10gDialect and Hibernate version used is 3.3.1.

Changes

None.

Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms