zoukankan      html  css  js  c++  java
  • Java 学习笔记(二)

       10、页面上显示的创建时间 比数据库里记录的多了14小时

      查看了 https://www.cnblogs.com/jason1990/archive/2018/11/28/10032181.html  之后 找到了解决方案是 在数据库链接后面加上

    serverTimezone=GMT%2B8
    jdbc:mysql://localhost:3306/table_name?useTimezone=true&serverTimezone=GMT%2B8

       11、pagehelper不起作用

    https://www.cnblogs.com/zqyw/p/11029116.html

    <dependency>
        <groupId>com.github.pagehelper</groupId>
        <artifactId>pagehelper-spring-boot-starter</artifactId>
        <version>1.2.5</version>
    </dependency>

     12、IDEA 不能实时刷新HTML页面 

             修改file->settings->build,excution,deployment->compiler->build project automatally

             在IDEA中,按快捷键:Ctrl+Shift+Alt+/, 选registry

             详细参见:https://www.cnblogs.com/xphhh/p/11355336.html

     13、IDEA Maven的Dependencies中出现红色波浪线   

             clean maven, 然后剪切pom.xml中的dependency, 保存; 再clean maven,再黏贴回来dependency,保存。 好了。 https://blog.csdn.net/u014672466/article/details/80211340

      14、遇到DataSource下载数据库驱动失败时,可以将文件拷到  C:Usersusername.IntelliJIdea2019.2configjdbc-driversMySQL ConnectorJ 88.0.15 目录下, 该目录下一共两个文件 mysql-connector-java-8.0.15.jar 和 mysql-connector-license.txt

             这里也有另外一种解决方案: https://www.cnblogs.com/badaoliumangqizhi/p/11885753.html 

      15、所有的Test方法都失败,原因竟然是源码编译不过!!

      16、有多个地方重复扫描了mapper

    10:09:44.643  WARN 10424 --- [  restartedMain] o.m.s.mapper.ClassPathMapperScanner      : Skipping MapperFactoryBean with name 'spSysTitleEmpDao' and 'com.speedpro.erp.factory.dao.SpSysTitleEmpDao' mapperInterface. Bean already defined with the same name!
    10:09:44.643 WARN 10424 --- [ restartedMain] o.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[com.speedpro.erp.factory.dao]' package. Please check your configuration.

       17、Invalid bound statement (not found): com.xxxxx.erp.factory.dao.SpInvInvoiceDao.queryById

       添加如下配置到pom.xml的build节点下:

            <resources>
                <resource>
                    <directory>${basedir}/src/main/java</directory>
                    <includes>
                        <include>**/*/*.xml</include>
                    </includes>
                </resource>
            </resources>

       18、输出mybatis的sql语句:

               在application.yml中的mybatis节点下添加  configuration :

    mybatis:
      mapper-locations: classpath:mapper/*/*.xml
      type-aliases-package: com.xxxxxx.erp.factory.entity
      not-empty: true
      identity: MYSQL
      configuration:
        log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

      19、 The bean 'scopedTarget.oauth2ClientContext', defined in class path resource [org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2RestOperationsConfiguration$SessionScopedConfiguration$ClientContextConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/security/oauth2/config/annotation/web/configuration/OAuth2ClientConfiguration$OAuth2ClientContextConfiguration.class] and overriding is disabled.

       在application.yml中添加

    spring:
      main:
        allow-bean-definition-overriding: true
  • 相关阅读:
    LeetCode 121. Best Time to Buy and Sell Stock
    LeetCode 221. Maximal Square
    LeetCode 152. Maximum Product Subarray
    LeetCode 53. Maximum Subarray
    LeetCode 91. Decode Ways
    LeetCode 64. Minimum Path Sum
    LeetCode 264. Ugly Number II
    LeetCode 263. Ugly Number
    LeetCode 50. Pow(x, n)
    LeetCode 279. Perfect Squares
  • 原文地址:https://www.cnblogs.com/crazyghostvon/p/Javalearn2.html
Copyright © 2011-2022 走看看