zoukankan      html  css  js  c++  java
  • springboot权限管理项目遇到的问题记录

    1.报MySQL版本的问题

    {
      "timestamp": "2019-12-09T14:04:19.605+0000",
      "status": 500,
      "error": "Internal Server Error",
      "message": "nested exception is org.apache.ibatis.exceptions.PersistenceException: 
    ### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
    ### The error may exist in file [D:\WorkSpace\StudioWorkSpace\mango\target\classes\com\louis\mango\sqlmap\SysUserMapper.xml]
    ### The error may involve com.louis.mango.dao.SysUserMapper.findAllUser
    ### The error occurred while executing a query
    ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.",
      "path": "/user/findAll"
    }
    

      解决方法:修改application.properties文件中的MySQL连接

    spring.datasource.driverClassName=com.mysql.jdbc.Driver
    #写成下面的写法,则会报错
    #spring.datasource.url=jdbc:mysql://localhost:3306/privilege?characterEncoding=utf-8&allowMultiQueries=true
    #需修改成如下的版本格式,才不会报错
    spring.datasource.url=jdbc:mysql://localhost:3306/privilege?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
    spring.datasource.username=root
    spring.datasource.password=123456
    

      

    2.spring注解方式 idea报could not autowire,eclipse却没有问题

    参考:https://www.cnblogs.com/softidea/p/5763285.html

    可在File -- Settings -- Inspections。使用搜索功能 找到 Autowired for Bean Class ,将Severity的级别由之前的error改成warning或其它可以忽略的级别。

  • 相关阅读:
    gcc编译器遇到的部分问题的总结(二)
    gcc编译器遇到的部分问题的总结
    Illegal instruction与march编译选项
    使用using与typedef来定义别名
    C++模板学习之递归
    C++模板学习之typename
    简单的listen+fork accept服务器实现
    一个简单的日志类的开发
    linux中的select和epoll模型
    程序异常退出调试(二)
  • 原文地址:https://www.cnblogs.com/qianshouxiuluo/p/12013757.html
Copyright © 2011-2022 走看看