Summary of problems encountered in springboot startup (continuously increasing)

When starting first:

1. Port occupation

The solution is to close other programs that occupy the port

2. The configuration file cannot be obtained

problem

3. The database configuration does not match the actual

The most common errors are: database password, database time zone, encoding,

4. When there are multiple environments, the active assignment of the profile

查看profile.active设置的值时候正确,这一般关系到你选中的数据库,以及对应的环境变量全局配置

5. Pom dependency download failed

The most common is that the pom dependency cannot be downloaded. The common solution is to set the mirror mirror configuration in maven's setttings.xml. You can use the aliyun mirror. For
example: (Solve the problem of slow dependency download or failure to download)

  <mirrors>
	<mirror>
          <id>alimaven</id>
          <mirrorOf>central</mirrorOf>
          <name>aliyun maven</name>
          <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
	</mirror>
  </mirrors>

6.redis is used in springboot

When starting, check whether redis has been started successfully, otherwise, an error will be reported when starting. (Redis generally mainly stores session information and token information. There are also some caches (such as data dictionary cache))

7. When used in combination with rabbitmq

There is a problem, the problem of the order case: the
solution:
add in the startup class:

    @Primary
    @Bean
    public TaskExecutor primaryTaskExecutor() {
    
    
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        return executor;
    }

. . . . to be continued

Guess you like

Origin blog.csdn.net/wangleisuiqiansuiyue/article/details/91048831