简体   繁体   English

应用程序无法加载请求的 class:com.mysql.cj.Z84BEFFD3A0D49636A58CE6080CAADriver.8

[英]Application could not load requested class : com.mysql.cj.jdbc.Driver

    Ιουν 10, 2020 2:57:56 ΜΜ org.hibernate.Version logVersion
    INFO: HHH000412: Hibernate Core {5.2.0.Final}
    Ιουν 10, 2020 2:57:56 ΜΜ org.hibernate.cfg.Environment <clinit>
    INFO: HHH000206: hibernate.properties not found
    Ιουν 10, 2020 2:57:56 ΜΜ org.hibernate.cfg.Environment buildBytecodeProvider
    INFO: HHH000021: Bytecode provider name : javassist
    Ιουν 10, 2020 2:57:56 ΜΜ org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
    INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
    Ιουν 10, 2020 2:57:56 ΜΜ 

    org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
    WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)
    Exception in thread "main" org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:244)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:208)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:189)
        at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:51)
        at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:217)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:189)
        at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.java:352)
        at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:111)
        at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:83)
        at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:418)
        at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:87)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:691)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:723)
        at com.luv2code.hibernate.demo.CreateStudentDemo.main(CreateStudentDemo.java:20)
    Caused by: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [com.mysql.cj.jdbc.Driver]
        at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:229)
        at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.loadDriverIfPossible(DriverManagerConnectionProviderImpl.java:161)
        at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.buildCreator(DriverManagerConnectionProviderImpl.java:117)
        at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:73)
        at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:217)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:189)
        at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.buildJdbcConnectionAccess(JdbcEnvironmentInitiator.java:145)
        at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:66)
        at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
        at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:88)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:234)
        ... 14 more
    Caused by: java.lang.ClassNotFoundException: Could not load requested class : com.mysql.cj.jdbc.Driver
        at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl$AggregatedClassLoader.findClass(ClassLoaderServiceImpl.java:217)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:226)
        ... 25 more

Anyone could help me with these errors?任何人都可以帮助我解决这些错误吗? I am trying to write data on database through hibernate, I add the jar files to my project (Right click->properties->Libraries我正在尝试通过 hibernate 在数据库中写入数据,我将 jar 文件添加到我的项目中(右键单击->属性->库

I use my-sql-coonector-java-5.1.49 and hibernate 5.2 .我使用mysql-coonector-java-5.1.49hibernate 5.2

Look at this .看看这个

The name of the class that implements java.sql.Driver in MySQL Connector/J has changed from com.mysql.jdbc.Driver to com.mysql.cj.jdbc.Driver . The name of the class that implements java.sql.Driver in MySQL Connector/J has changed from com.mysql.jdbc.Driver to com.mysql.cj.jdbc.Driver . The old class name has been deprecated.旧的 class 名称已被弃用。

It looks like you should use the old class name com.mysql.jdbc.Driver with my-sql-coonector-java-5.1.49 or as a better alternative I would suggest to use a 8.0 version of mysql jdbc driver. It looks like you should use the old class name com.mysql.jdbc.Driver with my-sql-coonector-java-5.1.49 or as a better alternative I would suggest to use a 8.0 version of mysql jdbc driver.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法从 HikariConfig 加载驱动程序 class com.mysql.cj.jdbc.Driver - Failed to load driver class com.mysql.cj.jdbc.Driver from HikariConfig 配置错误。 找不到 Class [com.mysql.cj.jdbc.Driver]。 EclipseLink, MySQL 驱动程序 - Configuration error. Class [com.mysql.cj.jdbc.Driver] not found. EclipseLink, MySQL driver java netbeans新的驱动程序类是`com.mysql.cj.jdbc.Driver&#39;。 - java netbeans The new driver class is `com.mysql.cj.jdbc.Driver' 在应用程序中,我具有对JDBC驱动程序的访问权限(java.lang.ClassNotFoundException除外:com.mysql.cj.jdbc.Driver) - In application I have acsess to JDBC driver (exception java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver) 我的 application.properties 中的属性显示为灰色。 构建成功但驱动程序 com.mysql.cj.jdbc.Driver 声称不接受 jdbcUrl - Properties in my application.properties are grayed out. Build success but Driver com.mysql.cj.jdbc.Driver claims to not accept jdbcUrl Liquibase Windows MySQL - Cannot find database driver: com.mysql.cj.jdbc.Driver - Liquibase Windows MySQL - Cannot find database driver: com.mysql.cj.jdbc.Driver centos8安装azkaban加载class`com.mysql.jdbc.Driver'。 这已被弃用。 新的驱动程序 class 是`com.mysql.cj.jdbc.Driver' - centos8 install azkaban Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver' Caused by: java.lang.RuntimeException: Driver com.mysql.cj.jdbc.Driver claims to not accept jdbcUrl - Caused by: java.lang.RuntimeException: Driver com.mysql.cj.jdbc.Driver claims to not accept jdbcUrl 我用驱动<com.mysql.cj.jdbc.driver> ,但“junit test”不断导致错误</com.mysql.cj.jdbc.driver> - I use the driver <com.mysql.cj.jdbc.Driver>, but 'junit test' keep causing error 独立的 jpackage 生成 java 应用程序为 com.mysql.cj.Z84BZFFD.5A0D4966AD1C50DA4BEC50Z.mysql.cj.Z84BZFFD.5A0D4967C7ACEr708Driver7A7086 - Stand alone jpackage generated java app generates ClassNotFoundException for com.mysql.cj.jdbc.Driver
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM