美文网首页
springboot错误笔记

springboot错误笔记

作者: 我是电饭煲 | 来源:发表于2020-03-31 00:09 被阅读0次

解决mongodb跨数据库访问超时问题

  • 导入配置插件
        <dependency>
            <groupId>com.spring4all</groupId>
            <artifactId>mongodb-plus-spring-boot-starter</artifactId>
            <version>1.0.0.RELEASE</version>
        </dependency>
  • 在application.yml添加配置
spring:
  data:
    mongodb:
      option:
        max-connection-idle-time: 60000
        #连接超时时间,默认值是0,就是不超时
        connect-timeout: 0
        max-connection-life-time: 0
        socket-keep-alive: true
        #阻塞线程获取连接的最长等待时间,默认120000 ms
        max-wait-time: 240000
        #客户端最大连接数,超过了将会被阻塞,默认100
        max-connection-per-host: 100

.gradle/caches

手动删除缓存

日志框架冲突

找到冲突的日志框架做处理(例如:slf4j-nop和slf4j-api)

java.lang.NoSuchFieldError: logger

https://blog.csdn.net/cml_blog/article/details/80894586

no active profile set falling back to default profiles default导致找不到配置

修改一下application.yml的spring.profiles.active或spring.profiles.include的值(无论什么)

SLF4J-jar包多绑定冲突解决,SLF4J: Class path contains multiple SLF4J bindings

https://blog.csdn.net/u014726937/article/details/51954186

数据库报错:The Server time zone value

https://blog.csdn.net/Wei_NiZi/article/details/81509822

Failed to configure a DataSource

https://blog.csdn.net/u010448530/article/details/80840828

返回报错

{
"timestamp": "2018-05-12T06:11:45.209+0000",
"status": 404,
"error": "Not Found",
"message": "No message available",
"path": "/index.html"
}

@RestController

spring boot整合shiro出现UnavailableSecurityManagerException

https://www.bbsmax.com/A/obzbMaVdED/

# 使用JDBC连接MySql时出现: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

jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC

Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.

Application.java文件不能放在src/java目录,要放在一个包上

# Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set using spring-boot

spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect

相关文章

网友评论

      本文标题:springboot错误笔记

      本文链接:https://www.haomeiwen.com/subject/waajwqtx.html