Spring Boot Test时遇到的问题

         在测试spring boot的test时,出现以下信息后,项目停止不动。

11:12:13,079 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
11:12:13,079 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
11:12:13,080 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/Users/lixinghao/company/com_tujia/gitlab/tujia_java_crm/crm-app/target/test-classes/logback.xml]
11:12:13,080 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
11:12:13,081 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [file:/Users/lixinghao/company/com_tujia/gitlab/tujia_java_crm/crm-app/target/test-classes/logback.xml]
11:12:13,081 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [file:/Users/lixinghao/company/com_tujia/gitlab/tujia_java_crm/crm-app/target/classes/logback.xml]
11:12:13,141 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
11:12:13,147 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Setting ReconfigureOnChangeFilter scanning period to 1 minutes
11:12:13,147 |-INFO in ReconfigureOnChangeFilter{invocationCounter=0} - Will scan for changes in [[/Users/lixinghao/company/com_tujia/gitlab/tujia_java_crm/crm-app/target/test-classes/logback.xml]] every 60 seconds. 
11:12:13,147 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Adding ReconfigureOnChangeFilter as a turbo filter
11:12:18,165 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
11:12:18,170 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CRM_APP_ALL]
11:12:18,215 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use gz compression
11:12:18,216 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern CATALINA_BASE_IS_UNDEFINED/logs/crm/crm_app_all-%d{yyyy-MM-dd}.log for the active file
11:12:18,219 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyy-MM-dd' from file name pattern 'CATALINA_BASE_IS_UNDEFINED/logs/crm/crm_app_all-%d{yyyy-MM-dd}.log.gz'.
11:12:18,219 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight.
11:12:18,219 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Fri Jul 26 11:11:27 CST 2019
11:12:18,220 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
11:12:18,242 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[CRM_APP_ALL] - Active log file name: CATALINA_BASE_IS_UNDEFINED/logs/crm_app_all.log
11:12:18,242 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[CRM_APP_ALL] - File property is set to [CATALINA_BASE_IS_UNDEFINED/logs/crm_app_all.log]
11:12:18,243 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.AsyncAppender]
11:12:18,244 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CRM_APP_ALL_ASYNC]
11:12:18,255 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CRM_APP_ALL] to ch.qos.logback.classic.AsyncAppender[CRM_APP_ALL_ASYNC]
11:12:18,255 |-INFO in ch.qos.logback.classic.AsyncAppender[CRM_APP_ALL_ASYNC] - Attaching appender named [CRM_APP_ALL] to AsyncAppender.
11:12:18,256 |-INFO in ch.qos.logback.classic.AsyncAppender[CRM_APP_ALL_ASYNC] - Setting discardingThreshold to 0
11:12:18,256 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
11:12:18,256 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CRM_APP_ALL_ASYNC] to Logger[ROOT]
11:12:18,256 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.xxl.job.core] to WARN
11:12:18,256 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
11:12:18,257 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@3d921e20 - Registering current configuration as safe fallback point

        发现在打印完logback的日志后,项目就停止不在运行。在查看了网上的各种操作之后,也没有很好的解决。后来想着既然是因为logback的问题不在向下执行,暂时将logback.xml过滤掉,不在防止logback.xml。结果发现可以正常运行测试项目。

        看网上其他博客说,出现这个问题的原因是因为maven依赖的jar包有冲突,目前尚未从jar包的冲突问题解决,(ps:小编也不大会怎么看jar包的冲突问题)。不过小编也会持续更新的哦。

你可能感兴趣的:(SpringBoot)