org.apache.catalina.core.StandardService - Stopping service [Tomcat]

今天在启动springboot项目突然启动失败,但是在测试日志文件,以为是日志出错,下面这个是logback打印的异常信息。

 

2019-05-30 15:09:10.686 [restartedMain] INFO com.alibaba.druid.pool.DruidDataSource - {dataSource-2} inited
2019-05-30 15:09:10.831 [restartedMain] INFO com.alibaba.druid.pool.DruidDataSource - {dataSource-2} closed
2019-05-30 15:09:10.833 [restartedMain] INFO org.apache.catalina.core.StandardService - Stopping service [Tomcat]

但其实错误在使用逆向工程时,重复运行导致mapper.xml文件错误。但是logback打印不出这个错误。闪电logback配置文件之后(当然有备份),springboot的默认日志(部分):

 

2019-05-30 15:19:25.261 INFO 12340 --- [ restartedMain] c.a.d.s.b.a.DruidDataSourceAutoConfigure : Init DruidDataSource
2019-05-30 15:19:25.857 INFO 12340 --- [ restartedMain] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} inited
2019-05-30 15:19:26.369 WARN 12340 --- [ restartedMain] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [D:\java\workspace\dbzx-navigate\target\classes\mapper\TxStudentMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.dbzx.mapper.TxStudentMapper.BaseResultMap
2019-05-30 15:19:26.373 INFO 12340 --- [ restartedMain] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} closed
2019-05-30 15:19:26.378 INFO 12340 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2019-05-30 15:19:26.404 INFO 12340 --- [ restartedMain] utoConfigurationReportLoggingInitializer :

 

看我标红的地方,这就指向很清晰了,后来发现是因为我在logback配置文件中加了:





%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n
utf-8



INFO
ACCEPT
DENY

 

日志的配置过滤掉了这个error级别的日志,所以无法显示。

 

因为之前也查了百度上关于这个异常的信息,出错的地方各不相同,所以还是要仔细查看日志。

转载于:https://www.cnblogs.com/whalesea/p/10949778.html

你可能感兴趣的:(org.apache.catalina.core.StandardService - Stopping service [Tomcat])