Hibernate java.lang.ClassCastException: oracle.jdbc.driver.OracleDriver cannot be cast to org.hiber...

3554 단어
org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider]
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:261)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:225)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
    at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:260)
    at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:94)
    at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
    at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1887)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1845)
    at com.zhaogd.myapplication.test.Test.main(Test.java:30)
Caused by: org.hibernate.HibernateException: Could not instantiate connection provider [oracle.jdbc.driver.OracleDriver]
    at org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator.instantiateExplicitConnectionProvider(ConnectionProviderInitiator.java:197)
    at org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator.initiateService(ConnectionProviderInitiator.java:120)
    at org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator.initiateService(ConnectionProviderInitiator.java:55)
    at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:105)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:251)
    ... 10 more
Caused by: java.lang.ClassCastException: oracle.jdbc.driver.OracleDriver cannot be cast to org.hibernate.engine.jdbc.connections.spi.ConnectionProvider
    at org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator.instantiateExplicitConnectionProvider(ConnectionProviderInitiator.java:194)
    ... 14 more

오늘 Hibernate 를 사용 하여 한참 동안 잘 하지 못 했 습 니 다. 인터넷 에서 이 문 제 를 검색 하 는 것 은 문제 가 너무 저급 한 것 같 습 니 다. 진지 하 게 비교 하지 못 했 습 니 다. 원래 Hibernate 프로필 에서 providerclass "> Oacle. jdbc. driver. Oracle Driver 가 잘못 쓴 것 같 습 니 다.
driver class "> oracle. jdbc. driver. Oracle Driver 로 인해 orcale 의 드라이버 ojdbc 6. jar, Hibernate 가 불 러 오지 않 았 습 니 다.
 
다음으로 전송:https://www.cnblogs.com/zhaogd/p/5215310.html

좋은 웹페이지 즐겨찾기