• grails3.1.5 com.mysql.jdbc.Driver


    【报错】

    Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.apache.tomcat.jdbc.pool.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:38)
    ... 85 common frames omitted

    ===================================================

    解决办法:

    在工程主目录中build.gradle添加如下代码:

    runtime "mysql:mysql-connector-java:5.1.38"

    【参考】http://stackoverflow.com/questions/33968150/grails-3-0-9-classnotfoundexception-com-mysql-jdbc-driver

  • 相关阅读:
    makefile vpath变量
    博客园 文章和随笔区别
    Linux OpenGL 实践篇-6 光照
    HTC Vive 叠影器无法创建设备
    Mybatis注解
    MyBatis缓存
    MyBatis关联映射
    动态sql
    MyBatis智能标签
    Mybatis模糊查询及自动映射
  • 原文地址:https://www.cnblogs.com/zhzhang/p/5396528.html
Copyright © 2020-2023  润新知