Springboot默认启用MongoDB,如果没有集成MongoDB在启动项目时会抛出异常:Exception in monitor thread while connecting to server localhost:27017;
只需要在启动类中修改注解:
将注解:
@SpringBootApplication
改为
@SpringBootApplication(exclude = {MongoAutoConfiguration.class, MongoDataAutoConfiguration.class})
即可禁用springboot自带的mongodb配置,项目启动正常。
修改前:
@Slf4j
@SpringBootApplication //默认启动mongodb
public class JeecgSystemApplication extends SpringBootServletInitializer {
}
修改后:
@Slf4j
@SpringBootApplication(exclude = {MongoAutoConfiguration.class, MongoDataAutoConfiguration.class})
public class JeecgSystemApplication extends SpringBootServletInitializer {
}