I recently decided to give JHipster a try in the development of a new Java application. So far it has been fine, but following the creation of a few entities, I am now getting an IllegalStateException for «Logback configuration error detected».
2016-01-12 23:08:00.187 ERROR 5972 --- [ restartedMain] o.s.boot.SpringApplication : Application startup failed
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - There is no conversion class registered for conversion word [wEx]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - [wEx] is not a valid conversion word
ERROR in ch.qos.logback.core.pattern.parser.Compiler@7abf4b83 - There is no conversion class registered for conversion word [wEx]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@7abf4b83 - [wEx] is not a valid conversion word
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:153) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:71) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:49) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:106) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:262) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:233) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:200) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:176) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:111) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:65) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:325) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:305) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at com.electom.higgler.Application.main(Application.java:74) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_66]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_66]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_66]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_66]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-1.3.1.RELEASE.jar:1.3.1.RELEASE]
Any assistance that may be rendered is greatly appreciated!
Thanks in advance!
asked Jan 13, 2016 at 4:24
1
It looks like your logback configuration has incorrect values. Specifically for the coloring feature of logback layouts.
I would refer to this posting and make sure you have the correct layout. Something like this perhaps:
public static final String CONSOLE_PATTERN =
"%yellow(%d{yyyy-MM-dd HH:mm:ss.SSS})"
answered Jul 4, 2016 at 2:26
Roy KachouhRoy Kachouh
1,80715 silver badges23 bronze badges
1
I recently started seeing an issue with AWS deploying my spring boot application via elastic beanstalk. My existing application was running and deployed successfully, but when I increased the ASG (auto scaling group) to a higher capacity the newly spun up instance fails with the below error. All successfully deployed and running instances fails to start after bouncing them with zero java application code changes and AWS environment changes. This feels like an issue with the AWS public AMIs, but after working with and AWS support engineer we were not able to identify the root cause even after downgrading to previous AMIs that have worked in the past with the exact same code base.
2022-11-08T22:11:24.241Z app="location-api"|ERROR|org.springframework.boot.SpringApplication|main|Application run failed
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.pattern.parser.Compiler@725bef66 - There is no conversion class registered for conversion word [X]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@725bef66 - [X] is not a valid conversion word
ERROR in ch.qos.logback.core.pattern.parser.Compiler@725bef66 - There is no conversion class registered for conversion word [X]
I previously was using the MDC «%X» qualifier to pull the MDC set values on a per thread basis. Even after removing that form my logback configuration I still receive the error stated above. I am currently using logback-core version 1.2.9. Below is two code snippets of the logback configuration that I receive the same error for. One without the use of the MDC «%X» qualifier and one with the use of the MDC «%X» qualifier.
Without MDC «%X»:
<appender class="ch.qos.logback.core.FileAppender" name="DEFAULT_APPENDER"> <append>true</append> <file>${LOG_FILE_LOCATION}/locationapi.log</file> <encoder> <pattern>%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX} app="location-api"|%p|%C|%t|%m%n</pattern> <charset>utf8</charset> </encoder> </appender>
With MDC «%X»:
<appender class="ch.qos.logback.core.FileAppender" name="DEFAULT_APPENDER"> <append>true</append> <file>${LOG_FILE_LOCATION}/locationapi.log</file> <encoder> <pattern>%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX} app="location-api", ehi-calling-application="%X{ehi-calling-application:-daemonThread}", jwt-subject="%X{jwt-subject:-daemonThread}", uri="%X{uri:-daemonThread}", http-method="%X{http-method:-daemonThread}", x-b3-traceid="%X{x-b3-traceid:-daemonThread}", x-b3-spanid="%X{x-b3-spanid:-daemonThread}"|%p|%C|%t|%m%n</pattern> <charset>utf8</charset> </encoder> </appender>
NOTE: I have not seen this error anywhere else on the web. In most cases with the conversion class not being registered is referring to the use of springs defaults.xml file which, from what I’ve read in the documentation, does not contain any definition for [X]. Again this has been working for months now, but all of a sudden stopped working with zero code or environment changes.
Thanks!
Hello,
I’m having problems with logback, i’m not sure if this is a bug, but certainly is very very weird behavior.
I just follow a tutorial (logback.qos.ch/manual/configuration.html#joranDirectly) to load the configuration xml from another place, when it load the xml this print a lot of errors:
_14:51:42,240 |-INFO in ch.qos.logback.classic.LoggerContext[default] — Could NOT find resource [logback.groovy]
14:51:42,240 |-INFO in ch.qos.logback.classic.LoggerContext[default] — Could NOT find resource [logback-test.xml]
14:51:42,240 |-INFO in ch.qos.logback.classic.LoggerContext[default] — Found resource [logback.xml] at file:/Test/target/classes/logback.xml
14:51:42,325 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction — debug attribute not set
14:51:42,329 |-INFO in ch.qos.logback.core.joran.action.AppenderAction — About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
14:51:42,337 |-INFO in ch.qos.logback.core.joran.action.AppenderAction — Naming appender as [STDOUT]
14:51:42,358 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA — Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
14:51:42,414 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction — Setting level of ROOT logger to WARN
14:51:42,414 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction — Attaching appender named [STDOUT] to Logger[ROOT]
14:51:42,414 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction — End of configuration.
14:51:42,415 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@e74eb02 — Registering current configuration as safe fallback point
14:51:42,429 |-INFO in ch.qos.logback.core.joran.action.AppenderAction — About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
14:51:42,429 |-INFO in ch.qos.logback.core.joran.action.AppenderAction — Naming appender as [STDOUT]
14:51:42,429 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA — Assuming default type [ch.qos.logback.access.PatternLayoutEncoder] for [encoder] property
14:51:42,443 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@6c9bc6a9 — There is no conversion class registered for conversion word [d]
14:51:42,443 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@6c9bc6a9 — [d] is not a valid conversion word
14:51:42,443 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@6c9bc6a9 — There is no conversion class registered for conversion word [thread]
14:51:42,443 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@6c9bc6a9 — [thread] is not a valid conversion word
14:51:42,443 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@6c9bc6a9 — There is no conversion class registered for conversion word [level]
14:51:42,443 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@6c9bc6a9 — [level] is not a valid conversion word
14:51:42,443 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@6c9bc6a9 — There is no conversion class registered for conversion word [logger]
14:51:42,443 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@6c9bc6a9 — [logger] is not a valid conversion word
14:51:42,443 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@6c9bc6a9 — There is no conversion class registered for conversion word [msg]
14:51:42,443 |-ERROR in ch.qos.logback.core.pattern.parser.Compiler@6c9bc6a9 — [msg] is not a valid conversion word
14:51:42,450 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@9:22 — no applicable action for [root], current ElementPath is [[configuration][root]]
14:51:42,451 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@10:32 — no applicable action for [appender-ref], current ElementPath is [[configuration][root][appender-ref]]
14:51:42,451 |-INFO in ch.qos.logback.access.joran.action.ConfigurationAction — End of configuration.
14:51:42,451 |-INFO in ch.qos.logback.access.joran.JoranConfigurator@32a0a9ac — Registering current configuration as safe fallback point
14:51:42,453 |-WARN in Logger[Main] — No appenders present in context [default] for logger [Main]._
To make sure this is a bug and not a bad configuration, i have created a maven project with only one java file
import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ch.qos.logback.access.joran.JoranConfigurator; import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.core.joran.spi.JoranException; public class Main { static Logger logger = LoggerFactory.getLogger(Main.class); public static void main(String[] args) { LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); try { JoranConfigurator configurator = new JoranConfigurator(); configurator.setContext(context); context.reset(); configurator.doConfigure(args[0]); } catch (JoranException je) { } logger.error("ASDF"); logger.info("ASDF"); logger.debug("ASDF"); logger.warn("ASDF"); logger.trace("ASDF"); } }
This is the logback.xml that i’m trying to load
<configuration debug="true"> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n </pattern> </encoder> </appender> <root level="debug"> <appender-ref ref="STDOUT" /> </root> </configuration>
and this is the pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>Test</groupId> <artifactId>Test</artifactId> <version>0.0.1</version> <name>Test</name> <description> </description> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-access</artifactId> <version>1.1.3</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.1.3</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-examples</artifactId> <version>1.1.3</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.12</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> <version>1.1.3</version> </dependency> </dependencies> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> </project>
if I comment the lines where it loads the external logback.xml its works without problems loading the logback under /src/main/resource
The behaviour of the PatternJsonProvider when it is given an invalid pattern differs depending on the type of error. Here are a few examples:
(1) Invalid conversion word in Pattern layout
The following JSON pattern refers to the log message using the %message
conversion word instead of %msg
:
The following error status is emitted when the provider is started but no exception is thrown:
09:58:13,556 |-ERROR in [email protected] - There is no conversion class registered for conversion word [message]
09:58:13,556 |-ERROR in [email protected] - [message] is not a valid conversion word
The provider is started and produces the following JSON output when serialising log events:
{"message":"%PARSER_ERROR[message]"}
(2) Syntax error in Pattern Layout
The following JSON pattern contains a syntax error (conversion word missing after %
):
This is causing an ERROR status with an exception when the provider is started:
10:29:04,107 |-ERROR in ch.qos.logback.classic.PatternLayout("%") - Failed to parse pattern "%". ch.qos.logback.core.spi.ScanException: Unexpected end of pattern string
at ch.qos.logback.core.spi.ScanException: Unexpected end of pattern string
at at ch.qos.logback.core.pattern.parser.TokenStream.tokenize(TokenStream.java:119)
at at ch.qos.logback.core.pattern.parser.Parser.<init>(Parser.java:68)
...
Unlike the previous case, the message field is now populated at runtime with an empty string instead of a «%PARSE_ERROR» special value:
(3) Invalid JSON pattern
The PatternJsonProvider accepts a valid JSON string for its «pattern» property. If the supplied value is not a valid JSON, an ERROR status is logged and the provider defaults to an empty pattern, producing nothing at runtime.
Example (missing closing quote):
Produces the following ERROR when the provider is started:
10:32:55,479 |-ERROR in net.logstash[email protected]536aaa8d - [pattern] is not a valid JSON object
And the following JSON is produced at runtime:
According to me, replacing the pattern with an error marker like %PARSE_ERROR
is not a good option. This will produce a valid JSON output at runtime in most cases making it difficult to notice something went wrong with the configuration. Even worst if it is wrapped with a #asLong
operation like this: { "age": "#asLong(%relative)" }
. The operation will receive the «%PARSE_ERROR» string and will fail to convert it to a long defaulting to null
.
IMHO, the best strategy is to log an ERROR status in all cases and don’t produce anything at runtime. This is the behaviour adopted by most of the other JsonProvider when their configuration is wrong: they simply revert producing nothing.
@philsttr What’s your opinion?
I’m configuring logs for Logback.
XML configuration looks like:
<configuration>
<appender name="console" class="...">
<encoder>
<pattern>Message:%nText: %m</pattern>
</encoder>
</appender>
...
</configuration>
The idea is that log record should be multiline:
Message:
Text: [Message text here]
But when I run app, I get an exception:
ERROR in [email protected] — There is no conversion class registered for conversion word [nText]
So, problem is that ‘%n’ and ‘Text’ strings are merged to one string.
As a workaround, I can write them separately with space:
Message:%n Text: %m
But in this case, the space appears in logs before ‘Text’
Message:
Text:
Is there some solution (escape character for empty string or similar)?
Thank you.
Недавно я решил попробовать JHipster в разработке нового Java-приложения. Пока все в порядке, но после создания нескольких сущностей я теперь получаю исключение IllegalStateException для «Обнаружена ошибка конфигурации Logback».
2016-01-12 23:08:00.187 ERROR 5972 --- [ restartedMain] o.s.boot.SpringApplication : Application startup failed
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - There is no conversion class registered for composite conversion word [clr]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - Failed to create converter for [%clr] keyword
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - There is no conversion class registered for conversion word [wEx]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@30655222 - [wEx] is not a valid conversion word
ERROR in ch.qos.logback.core.pattern.parser.Compiler@7abf4b83 - There is no conversion class registered for conversion word [wEx]
ERROR in ch.qos.logback.core.pattern.parser.Compiler@7abf4b83 - [wEx] is not a valid conversion word
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:153) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:71) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:49) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:106) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:262) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:233) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:200) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:176) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119) ~[spring-context-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:111) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:65) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:325) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:305) ~[spring-boot-1.3.1.RELEASE.jar:1.3.1.RELEASE]
at com.electom.higgler.Application.main(Application.java:74) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_66]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_66]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_66]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_66]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-1.3.1.RELEASE.jar:1.3.1.RELEASE]
Мы очень ценим любую помощь, которая может быть оказана!
Заранее спасибо!
1 ответ
Лучший ответ
Похоже, в вашей конфигурации входа в систему указаны неверные значения. Специально для функции раскраски макетов входа в систему.
Я хотел бы сослаться на эту публикацию и убедиться, что у вас правильный макет. Возможно, что-то вроде этого:
public static final String CONSOLE_PATTERN =
"%yellow(%d{yyyy-MM-dd HH:mm:ss.SSS})"
1
Roy Kachouh
4 Июл 2016 в 05:26
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
Я подозреваю, что это дубликат №5568. @checketts , пожалуйста, попробуйте сделать снимок 1.3.4 или заменить версию Logback на 1.1.7
@checketts , обновление версии Logback до 1.1.7 устраняет эту проблему для меня. Спасибо.
@wilkinsona Просто чтобы дать вам
@checketts Спасибо за обновление. Учитывая успех, о котором сообщил @pfernandom , я сейчас закрываю эту проблему. Если выяснится, что проблема не решена обновлением Logback, сообщите нам, и мы можем снова открыть.
@wilkinsona Обновление до logback 1.1.7 не решило эту проблему.
Мы видим это прежде всего в наших интеграционных тестах. Сообщение об ошибке немного изменилось по сравнению с тем, которое я опубликовал ранее, хотя мы видели это же сообщение об ошибке ( stream closed
) и раньше.
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:228)
at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.springTestContextPrepareTestInstance(AbstractTestNGSpringContextTests.java:149)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:170)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:104)
at org.testng.TestRunner.privateRun(TestRunner.java:774)
at org.testng.TestRunner.run(TestRunner.java:624)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312)
at org.testng.SuiteRunner.run(SuiteRunner.java:261)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1215)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
at org.testng.TestNG.run(TestNG.java:1048)
at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.runTests(TestNGTestClassProcessor.java:133)
at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.stop(TestNGTestClassProcessor.java:83)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.stop(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:360)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in c.q.l.c.recovery.ResilientFileOutputStream<strong i="9">@761951571</strong> - IO failure while writing to file [logs/output.log] java.io.IOException: Stream Closed
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:153)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:71)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:49)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:106)
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:262)
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:233)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:200)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119)
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:111)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:65)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:330)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:98)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
... 51 more
Две другие детали, которые могут помочь диагностировать это:
1- Мы используем Spring Cloud. Что инициализирует BootStrapApplicationContext
, я подозреваю, что когда основной контекст приложения перезапускает повторную инициализацию ведения журнала, это вызывает это.
2- Мы используем файл logback-spring.xml
поэтому мы можем использовать функциональность <springProperty>
.
Другой набор сообщений об ошибках, которые я могу видеть: 'File' option has the same value "logs/output.log" as that given for appender [FILE] defined earlier
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - 'File' option has the same value "logs/output.log" as that given for appender [FILE] defined earlier.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Collisions detected with FileAppender/RollingAppender instances defined earlier. Aborting.
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - For more information, please visit http://logback.qos.ch/codes.html#earlier_fa_collision
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:153)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:71)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:49)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:106)
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:262)
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:233)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:200)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119)
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:111)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:65)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:330)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:134)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:129)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:78)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:58)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119)
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:111)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:65)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:330)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:98)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:228)
at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.springTestContextPrepareTestInstance(AbstractTestNGSpringContextTests.java:149)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:170)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:104)
at org.testng.TestRunner.privateRun(TestRunner.java:774)
at org.testng.TestRunner.run(TestRunner.java:624)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312)
at org.testng.SuiteRunner.run(SuiteRunner.java:261)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1215)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
at org.testng.TestNG.run(TestNG.java:1048)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:74)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:121)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Хорошая (и плохая) новость в том, что теперь я могу делать эту ошибку каждый раз. Стоит ли мне попробовать использовать 1.3.4-SNAPSHOT
или вы удалили там обходной путь?
@checketts Можете ли вы поделиться чем-то, что постоянно повторяет проблему?
@philwebb Да! Думаю, я нашел первопричину. Итак, у нас есть код, который добавляет дополнительные PropertySources
, а затем запускает код LoggingApplicationInitializer
который инициализирует ведение журнала.
Однако оказалось, что мой код, который добавлял дополнительный источник свойств и запускал повторную инициализацию ведения журнала, выполнялся в отдельном потоке. Итак, я предполагаю, что он начал повторную инициализацию ведения журнала во втором потоке, в то время как основной поток делал то же самое.
Может быть, решение будет таким же простым, как заставить метод initialize
использовать синхронизированный блок? https://github.com/spring-projects/spring-boot/blob/2364bcc1172b570f917dc24819776813cb27def0/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener4.java
Дайте мне знать, если вам нужны более подробные сведения.
В приложении, с которым я боролся, я просто удостоверился, что сбойный путь не приводит к выделению асинхронного потока для выполнения своей работы, и проблема исчезла.
Мы сталкиваемся с этой проблемой довольно часто, у нас есть приложение spring boot (1.3.0) с гибернацией.
hibernate, и мы используем внешний logback.xml. Мы обновили логбэк до 1.1.7, но безуспешно.
Похоже, что Hibernate Validator инициализируется в другом потоке с помощью BackgroundPreinitializer.
Когда весенняя загрузка повторно настраивает систему ведения журнала, Hibernate Validator имеет дескриптор для старого экземпляра регистратора, что вызывает проблему.
Следы стека:
stacktrace.txt
Журналы дефектов:
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in c.q.l.c.recovery.ResilientFileOutputStream<strong i="14">@885755284</strong> - IO failure while writing to file [C:testProjectlogsserver.log] java.io.IOException: Stream Closed
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:153) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.boot.logging.logback.LogbackLoggingSystem.reinitialize(LogbackLoggingSystem.java:197) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:64) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:49) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:106) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:261) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:232) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:199) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:176) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:111) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:65) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:315) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:295) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.boot.context.web.SpringBootServletInitializer.run(SpringBootServletInitializer.java:149) [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.boot.context.web.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:129) [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.boot.context.web.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:85) [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175) [spring-web-4.2.3.RELEASE.jar:4.2.3.RELEASE]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5170) [catalina.jar:8.0.28]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:8.0.28]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) [catalina.jar:8.0.28]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) [catalina.jar:8.0.28]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) [catalina.jar:8.0.28]
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945) [catalina.jar:8.0.28]
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1798) [catalina.jar:8.0.28]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.8.0_91]
at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_91]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_91]
**ПЕРВОПРИЧИНА:
Стек потоков: при инициализации системы по умолчанию: **
Thread [main] (Suspended (breakpoint at line 27 in ResilientFileOutputStream))
owns: LogbackLock (id=30)
ResilientFileOutputStream.<init>(File, boolean) line: 27
RollingFileAppender<E>(FileAppender<E>).openFile(String) line: 148
RollingFileAppender<E>(FileAppender<E>).start() line: 108
RollingFileAppender<E>.start() line: 86
AppenderAction<E>.end(InterpretationContext, String) line: 96
Interpreter.callEndAction(List<Action>, String) line: 317
Interpreter.endElement(String, String, String) line: 196
Interpreter.endElement(EndEvent) line: 182
EventPlayer.play(List<SaxEvent>) line: 62
JoranConfigurator(GenericConfigurator).doConfigure(List<SaxEvent>) line: 149
JoranConfigurator(GenericConfigurator).doConfigure(InputSource) line: 135
JoranConfigurator(GenericConfigurator).doConfigure(InputStream) line: 99
JoranConfigurator(GenericConfigurator).doConfigure(URL) line: 49
ContextInitializer.configureByResource(URL) line: 77
ContextInitializer.autoConfig() line: 152
StaticLoggerBinder.init() line: 85
StaticLoggerBinder.<clinit>() line: 55
LoggerFactory.bind() line: 140
LoggerFactory.performInitialization() line: 119
LoggerFactory.getILoggerFactory() line: 328
LoggerFactory.getLogger(String) line: 280
SLF4JLogFactory.getInstance(String) line: 155
SLF4JLogFactory.getInstance(Class) line: 132
LogFactory.getLog(Class) line: 273
SpringApplication.<init>(Object...) line: 181
SpringApplication.run(Object[], String[]) line: 1112
SpringApplication.run(Object, String...) line: 1101
`
**Thread Stack: when logging system is reconfigured by spring and it’s trying to shut down existing system: (Notice output stream is being closed here)**
`
Thread [main] (Suspended (breakpoint at line 111 in ResilientOutputStreamBase))
ResilientFileOutputStream(ResilientOutputStreamBase).close() line: 111
RollingFileAppender<E>(OutputStreamAppender<E>).closeOutputStream() line: 131
RollingFileAppender<E>(OutputStreamAppender<E>).stop() line: 116
RollingFileAppender<E>.stop() line: 106
AppenderAttachableImpl<E>.detachAndStopAllAppenders() line: 104
Logger.detachAndStopAllAppenders() line: 209
Logger.recursiveReset() line: 338
LoggerContext.reset() line: 213
LogbackLoggingSystem.reinitialize(LoggingInitializationContext) line: 195
LogbackLoggingSystem(AbstractLoggingSystem).initializeWithConventions(LoggingInitializationContext, LogFile) line: 64
LogbackLoggingSystem(AbstractLoggingSystem).initialize(LoggingInitializationContext, String, LogFile) line: 49
LogbackLoggingSystem.initialize(LoggingInitializationContext, String, LogFile) line: 106
LoggingApplicationListener.initializeSystem(ConfigurableEnvironment, LoggingSystem) line: 261
LoggingApplicationListener.initialize(ConfigurableEnvironment, ClassLoader) line: 232
LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(ApplicationEnvironmentPreparedEvent) line: 199
LoggingApplicationListener.onApplicationEvent(ApplicationEvent) line: 176
SimpleApplicationEventMulticaster.invokeListener(ApplicationListener, ApplicationEvent) line: 163
SimpleApplicationEventMulticaster.multicastEvent(ApplicationEvent, ResolvableType) line: 136
SimpleApplicationEventMulticaster.multicastEvent(ApplicationEvent) line: 119
EventPublishingRunListener.publishEvent(SpringApplicationEvent) line: 111
EventPublishingRunListener.environmentPrepared(ConfigurableEnvironment) line: 65
SpringApplicationRunListeners.environmentPrepared(ConfigurableEnvironment) line: 54
SpringApplication.doRun(SpringApplicationRunListeners, String...) line: 315
SpringApplication.run(String...) line: 295
SpringApplication.run(Object[], String[]) line: 1112
SpringApplication.run(Object, String...) line: 1101
TestApplication.main(String[]) line: 80
`
**Thread Stack: when logging system is reconfigured spring: (Notice new stream being created)**
`com.test.TestApplication at localhost:60330
Thread [main] (Suspended (breakpoint at line 27 in ResilientFileOutputStream))
owns: LogbackLock (id=30)
ResilientFileOutputStream.<init>(File, boolean) line: 27
RollingFileAppender<E>(FileAppender<E>).openFile(String) line: 148
RollingFileAppender<E>(FileAppender<E>).start() line: 108
RollingFileAppender<E>.start() line: 86
AppenderAction<E>.end(InterpretationContext, String) line: 96
Interpreter.callEndAction(List<Action>, String) line: 317
Interpreter.endElement(String, String, String) line: 196
Interpreter.endElement(EndEvent) line: 182
EventPlayer.play(List<SaxEvent>) line: 62
SpringBootJoranConfigurator(GenericConfigurator).doConfigure(List<SaxEvent>) line: 149
SpringBootJoranConfigurator(GenericConfigurator).doConfigure(InputSource) line: 135
SpringBootJoranConfigurator(GenericConfigurator).doConfigure(InputStream) line: 99
SpringBootJoranConfigurator(GenericConfigurator).doConfigure(URL) line: 49
LogbackLoggingSystem.configureByResourceUrl(LoggingInitializationContext, LoggerContext, URL) line: 165
LogbackLoggingSystem.loadConfiguration(LoggingInitializationContext, String, LogFile) line: 137
LogbackLoggingSystem.reinitialize(LoggingInitializationContext) line: 197
LogbackLoggingSystem(AbstractLoggingSystem).initializeWithConventions(LoggingInitializationContext, LogFile) line: 64
LogbackLoggingSystem(AbstractLoggingSystem).initialize(LoggingInitializationContext, String, LogFile) line: 49
LogbackLoggingSystem.initialize(LoggingInitializationContext, String, LogFile) line: 106
LoggingApplicationListener.initializeSystem(ConfigurableEnvironment, LoggingSystem) line: 261
LoggingApplicationListener.initialize(ConfigurableEnvironment, ClassLoader) line: 232
LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(ApplicationEnvironmentPreparedEvent) line: 199
LoggingApplicationListener.onApplicationEvent(ApplicationEvent) line: 176
SimpleApplicationEventMulticaster.invokeListener(ApplicationListener, ApplicationEvent) line: 163
SimpleApplicationEventMulticaster.multicastEvent(ApplicationEvent, ResolvableType) line: 136
SimpleApplicationEventMulticaster.multicastEvent(ApplicationEvent) line: 119
EventPublishingRunListener.publishEvent(SpringApplicationEvent) line: 111
EventPublishingRunListener.environmentPrepared(ConfigurableEnvironment) line: 65
SpringApplicationRunListeners.environmentPrepared(ConfigurableEnvironment) line: 54
SpringApplication.doRun(SpringApplicationRunListeners, String...) line: 315
SpringApplication.run(String...) line: 295
SpringApplication.run(Object[], String[]) line: 1112
SpringApplication.run(Object, String...) line: 1101
TestApplication.main(String[]) line: 80
`
**And here come the Show Stopper (This Thread is fire flush on output stream which is already closed)**
` Thread [pool-1-thread-1] (Suspended (breakpoint at line 101 in ResilientOutputStreamBase))
ResilientFileOutputStream(ResilientOutputStreamBase).postIOFailure(IOException) line: 101
ResilientFileOutputStream(ResilientOutputStreamBase).flush() line: 82
PatternLayoutEncoder(LayoutWrappingEncoder<E>).doEncode(E) line: 137
RollingFileAppender<E>(OutputStreamAppender<E>).writeOut(E) line: 194
RollingFileAppender<E>(FileAppender<E>).writeOut(E) line: 220
RollingFileAppender<E>(OutputStreamAppender<E>).subAppend(E) line: 219
RollingFileAppender<E>.subAppend(E) line: 182
RollingFileAppender<E>(OutputStreamAppender<E>).append(E) line: 103
RollingFileAppender<E>(UnsynchronizedAppenderBase<E>).doAppend(E) line: 88
AppenderAttachableImpl<E>.appendLoopOnAppenders(E) line: 48
Logger.appendLoopOnAppenders(ILoggingEvent) line: 273
Logger.callAppenders(ILoggingEvent) line: 260
Logger.buildLoggingEventAndAppend(String, Marker, Level, String, Object[], Throwable) line: 442
Logger.filterAndLog_0_Or3Plus(String, Marker, Level, String, Object[], Throwable) line: 396
Logger.log(Marker, String, int, String, Object[], Throwable) line: 788
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
Method.invoke(Object, Object...) line: 498
Slf4jLocationAwareLogger.doLog(LocationAwareLogger, String, int, String, Throwable) line: 89
Slf4jLocationAwareLogger.doLogf(Logger$Level, String, String, Object[], Throwable) line: 82
Slf4jLocationAwareLogger(Logger).logf(String, Logger$Level, Throwable, String, Object) line: 2398
Log_$logger.version(String) line: 211
Version.<clinit>() line: 17
ConfigurationImpl.<clinit>() line: 69
HibernateValidator.createGenericConfiguration(BootstrapState) line: 31
Validation$GenericBootstrapImpl.configure() line: 276
BackgroundPreinitializer$ValidationInitializer.run() line: 107
BackgroundPreinitializer$FailSafeRunnable.run() line: 67
Executors$RunnableAdapter<T>.call() line: 511
FutureTask<V>.run() line: 266
ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker) line: 1142
ThreadPoolExecutor$Worker.run() line: 617
Thread.run() line: 745
Мне также нужно сообщить, что мое предположение о моем исправлении многопоточности было неполным. Мой код делал его намного хуже, но даже после его удаления я все еще иногда получаю:
java.lang.IllegalStateException: Logback configuration error detected: ERROR in c.q.l.c.recovery.ResilientFileOutputStream<strong i="6">@885755284</strong> - IO failure while writing to file
Прерывание реконфигурации ведения журнала
Я должен предоставить обходной путь. Есть ли способ отключить повторную инициализацию работы журнала или можно ли настроить валидатор Hibernate для инициализации в основном потоке?
Интересно, связано ли это с моей проблемой № 6831, которая сейчас поднята с командой Spring Cloud?
Симптомы моей проблемы похожи на # 4871. Мы постараемся обновить наш продукт до более поздней версии весенней загрузки и тестирования. Между тем, мы планируем либо переопределить org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LoggingInitializationContext, String, LogFile)
и добавить некоторую задержку, чтобы позволить BackgroundPreinitializer
завершить.
или переопределить org.springframework.boot.logging.logback.LogbackLoggingSystem.reinitialize(LoggingInitializationContext)
@NiteshMehta Помогла ли ваша работа? Мы сталкиваемся с аналогичной проблемой, поэтому не уверены, сработает ли просто обновление logback до 1.17.
@ bin01 Обновление журнала до 1.1.7 не помогло, и мы еще не обновили весеннюю загрузку. Обходной путь, который мы сделали, работает для нас. Он немного отличается от упомянутого выше. Поскольку мы ведем ведение журнала с помощью logback.xml, а не путем записи конфигурации в application.properties, мы пропустили обновление LogbackLoggingSystem
. Вот что мы сделали: мы создали класс ниже и добавили его в путь к классам.
import org.springframework.boot.logging.LoggingInitializationContext;
import org.springframework.boot.logging.logback.LogbackLoggingSystem;
public class AppLoggingSystem extends LogbackLoggingSystem {
public AppLoggingSystem(ClassLoader classLoader) {
super(classLoader);
}
<strong i="8">@Override</strong>
protected void reinitialize(LoggingInitializationContext initializationContext) {
//Workaround for spring and logback integration issue https://github.com/spring-projects/spring-boot/issues/5669";
//Skipping re-initialization of Logback, because we are using logback xml configuration which is already initialized
}
}
затем передано -Dorg.springframework.boot.logging.LoggingSystem=com.ca.tdm.utils.AppLoggingSystem
как аргумент jvm.
и мы закончили.
вы также можете попробовать переключиться на другую систему ведения журнала.
как -Dorg.springframework.boot.logging.LoggingSystem=org.springframework.boot.logging.log4j.Log4JLoggingSystem
@NiteshMehta Большое спасибо!
Я постоянно сталкивался с этой проблемой, когда указывал $ TRACE = true в тесте интеграции Spring Cloud Services (обратите внимание на себя, если меня попросят воспроизвести проблему: ConfigServerSecurityIntegrationTests.java) на основе Spring Boot 1.5.2.RELEASE и logback 1.1 .11. Проблема не возникает при $ DEBUG = true. Есть новости об окончательном решении?
Мы периодически наблюдаем одну и ту же проблему на некоторых виртуальных машинах (только для Linux — мы не видим этого в Windows). Плохо то, что при запуске происходит сбой, а приложение не запускается. Скорейшее решение будет действительно полезным. Сначала я постараюсь последовательно воспроизвести проблему в своей настройке, чтобы найти первопричину. Таким образом, мы не делаем ничего особенного с фреймворком журналирования, за исключением использования конфигурации на основе logback-spring.xml.
В частности, вот полученная нами трассировка стека:
2017-04-21 08:47:38.989 ERROR o.s.boot.SpringApplication - Application startup failed
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in c.q.l.c.recovery.ResilientFileOutputStream<strong i="7">@1758008124</strong> - IO failure while writing to file [gatewaylogs/gateway.log] java.io.IOException: Stream Closed
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:161)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:81)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:59)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:114)
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:303)
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:276)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:239)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:212)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:73)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:336)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
@glyn является ConfigServerSecurityIntegrationTests
, или мы можем получить к нему доступ?
@philwebb Это личное, но я добавил вас в качестве соавтора, и вы должны были получить приглашение. Я провожу этот единственный тест под IntelliJ, чтобы воспроизвести проблему. Сообщите мне, если вы не можете получить доступ или у вас возникнут проблемы с воспроизведением проблемы.
@glyn Вы
@philwebb Без hasged на виртуальных машинах Linux с низкой энтропией файловой системы запуск происходит медленно. Может ли это вызвать состояние гонки? Просто мысль.
@sandipchitale Я пробовал только на macOS, а не на Linux.
Провел больше тестов по этому поводу. Я обнаружил, что если я пройду
-Dlogging.level.=TRACE
через системное свойство я сталкиваюсь с проблемой 1 из 5 раз. Однако, если я установлю уровень logging.level. в application.yml я не могу воспроизвести проблему. Так может ли это быть проблемой состояния гонки инициализации среды? И глядя на трассировку стека, это вроде намекает на то, что это связано с инициализацией среды.
Когда вы запускаете ведение журнала на уровне DEBUG или TRACE, создается гораздо больший вывод журнала. Таким образом, это также может быть связано с размером пролонгации журнала для добавителей журнала, а также с тем, переносятся ли файлы журнала и архивируются.
@glyn Не могли бы вы также добавить меня в качестве соавтора?
@wilkinsona Добавлено. Пожалуйста, проверьте свою электронную почту.
Спасибо, @glyn.
Я могу надежно воспроизвести сбой, запустив ConfigServerSecurityIntegrationTests.vaultRenewalWithUserTokenIsOk
с включением ведения журнала уровня трассировки:
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
at org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance(SpringBootDependencyInjectionTestExecutionListener.java:44)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:230)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:228)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:287)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:289)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:247)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in c.q.l.c.recovery.ResilientFileOutputStream<strong i="8">@749098095</strong> - IO failure while writing to file [/var/folders/zq/v6xkr2696kv05jbf3bddt9680000gn/T/spring.log] java.io.IOException: Stream Closed
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:162)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.reinitialize(LogbackLoggingSystem.java:208)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:74)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:59)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:115)
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:303)
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:276)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:239)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:212)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:296)
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:120)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:98)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:116)
... 30 more
@wilkinsona Спасибо. Говорят, общая проблема — это проблема вдвое …
Исправление # 9869 не решает проблему, но я думаю, что знаю, что будет.
Основная причина, по-видимому, в том, что мы возвращаемся из SpringApplication.run
то время как предварительная инициализация в фоновом режиме все еще продолжается. Затем открывается окно для состязания между потоком предварительной инициализации в фоновом режиме, использующим систему ведения журнала, и чем-то другим, пытающимся его настроить. Это с большей вероятностью произойдет в приложении Spring Cloud благодаря контексту начальной загрузки и дополнительной инициализации системы журналов, которую он выполняет для сбора изменений, которые могли быть получены с сервера конфигурации.
Некоторое первоначальное тестирование предполагает, что обновление фонового преинициализатора для обработки ApplicationReadyEvent
и ApplicationFailedEvent
и блокировки до завершения фоновой предварительной инициализации решит проблему. К счастью, при включенной трассировке информационного уровня, похоже, это незначительно повлияет на время запуска. Нам действительно приходится ждать, только когда в фоновом потоке ведется много журналов.
Я получаю эту ошибку в 2020 и Spring Boot 2.2.4 и Logback 1.2.3
Конфигурация работала при загрузке из application.yml, но затем мне пришлось переместить ее в logback-spring.xml, и та же строка шаблона не работает, возникает такая же ошибка.
@StepeCZ Если вы можете создать минимальный образец, который воспроизводит проблему, создайте новый выпуск, прикрепив образец, и мы сможем взглянуть на него.
Была ли эта страница полезной?
0 / 5 — 0 рейтинги
Best Java code snippets using ch.qos.logback.core.pattern.parser.Compiler.addError (Showing top 20 results out of 315)
@SuppressWarnings("unchecked") DynamicConverter<E> createConverter(SimpleKeywordNode kn) { String keyword = (String) kn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (DynamicConverter) OptionHelper.instantiateByClassName( converterClassStr, DynamicConverter.class, context); } catch (Exception e) { addError("Failed to instantiate converter class [" + converterClassStr + "] for keyword ["+keyword+"]", e); return null; } } else { addError("There is no conversion class registered for conversion word [" + keyword + "]"); return null; } }
@SuppressWarnings("unchecked") CompositeConverter<E> createCompositeConverter(CompositeNode cn) { String keyword = (String) cn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (CompositeConverter) OptionHelper.instantiateByClassName( converterClassStr, CompositeConverter.class, context); } catch (Exception e) { addError("Failed to instantiate converter class [" + converterClassStr + "] as a composite converter for keyword ["+keyword+"]", e); return null; } } else { addError("There is no conversion class registered for composite conversion word [" + keyword + "]"); return null; } }
@SuppressWarnings("unchecked") DynamicConverter<E> createConverter(SimpleKeywordNode kn) { String keyword = (String) kn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (DynamicConverter) OptionHelper.instantiateByClassName(converterClassStr, DynamicConverter.class, context); } catch (Exception e) { addError("Failed to instantiate converter class [" + converterClassStr + "] for keyword [" + keyword + "]", e); return null; } } else { addError("There is no conversion class registered for conversion word [" + keyword + "]"); return null; } }
@SuppressWarnings("unchecked") CompositeConverter<E> createCompositeConverter(CompositeNode cn) { String keyword = (String) cn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (CompositeConverter<E>) OptionHelper.instantiateByClassName( converterClassStr, CompositeConverter.class, context); } catch (Exception e) { addError("Failed to instantiate converter class [" + converterClassStr + "] as a composite converter for keyword ["+keyword+"]", e); return null; } } else { addError("There is no conversion class registered for composite conversion word [" + keyword + "]"); return null; } }
@SuppressWarnings("unchecked") DynamicConverter<E> createConverter(SimpleKeywordNode kn) { String keyword = (String) kn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (DynamicConverter) OptionHelper.instantiateByClassName(converterClassStr, DynamicConverter.class, context); } catch (Exception e) { addError("Failed to instantiate converter class [" + converterClassStr + "] for keyword [" + keyword + "]", e); return null; } } else { addError("There is no conversion class registered for conversion word [" + keyword + "]"); return null; } }
@SuppressWarnings("unchecked") CompositeConverter<E> createCompositeConverter(CompositeNode cn) { String keyword = (String) cn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (CompositeConverter) OptionHelper.instantiateByClassName(converterClassStr, CompositeConverter.class, context); } catch (Exception e) { addError("Failed to instantiate converter class [" + converterClassStr + "] as a composite converter for keyword [" + keyword + "]", e); return null; } } else { addError("There is no conversion class registered for composite conversion word [" + keyword + "]"); return null; } }
@SuppressWarnings("unchecked") CompositeConverter<E> createCompositeConverter(CompositeNode cn) { String keyword = (String) cn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (CompositeConverter) OptionHelper.instantiateByClassName( converterClassStr, CompositeConverter.class, context); } catch (Exception e) { addError("Failed to instantiate converter class [" + converterClassStr + "] as a composite converter for keyword ["+keyword+"]", e); return null; } } else { addError("There is no conversion class registered for composite conversion word [" + keyword + "]"); return null; } }
@SuppressWarnings("unchecked") CompositeConverter<E> createCompositeConverter(CompositeNode cn) { String keyword = (String) cn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (CompositeConverter) OptionHelper.instantiateByClassName(converterClassStr, CompositeConverter.class, context); } catch (Exception e) { addError("Failed to instantiate converter class [" + converterClassStr + "] as a composite converter for keyword [" + keyword + "]", e); return null; } } else { addError("There is no conversion class registered for composite conversion word [" + keyword + "]"); return null; } }
@SuppressWarnings("unchecked") DynamicConverter<E> createConverter(SimpleKeywordNode kn) { String keyword = (String) kn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (DynamicConverter) OptionHelper.instantiateByClassName( converterClassStr, DynamicConverter.class, context); } catch (Exception e) { addError("Failed to instantiate converter class [" + converterClassStr + "] for keyword ["+keyword+"]", e); return null; } } else { addError("There is no conversion class registered for conversion word [" + keyword + "]"); return null; } }
@SuppressWarnings("unchecked") DynamicConverter<E> createConverter(SimpleKeywordNode kn) { String keyword = (String) kn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (DynamicConverter) OptionHelper.instantiateByClassName(converterClassStr, DynamicConverter.class, context); } catch (Exception e) { addError("Failed to instantiate converter class [" + converterClassStr + "] for keyword [" + keyword + "]", e); return null; } } else { addError("There is no conversion class registered for conversion word [" + keyword + "]"); return null; } }
@SuppressWarnings("unchecked") DynamicConverter<E> createConverter(SimpleKeywordNode kn) { String keyword = (String) kn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (DynamicConverter<E>) OptionHelper.instantiateByClassName( converterClassStr, DynamicConverter.class, context); } catch (Exception e) { addError("Failed to instantiate converter class [" + converterClassStr + "] for keyword ["+keyword+"]", e); return null; } } else { addError("There is no conversion class registered for conversion word [" + keyword + "]"); return null; } }
@SuppressWarnings("unchecked") CompositeConverter<E> createCompositeConverter(CompositeNode cn) { String keyword = (String) cn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (CompositeConverter) OptionHelper.instantiateByClassName(converterClassStr, CompositeConverter.class, context); } catch (Exception e) { addError("Failed to instantiate converter class [" + converterClassStr + "] as a composite converter for keyword [" + keyword + "]", e); return null; } } else { addError("There is no conversion class registered for composite conversion word [" + keyword + "]"); return null; } }
@SuppressWarnings("unchecked") CompositeConverter<E> createCompositeConverter(CompositeNode cn) { String keyword = (String) cn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (CompositeConverter) OptionHelper.instantiateByClassName( converterClassStr, CompositeConverter.class, context); } catch (Exception e) { addError("Failed to instantiate converter class [" + converterClassStr + "] as a composite converter for keyword ["+keyword+"]", e); return null; } } else { addError("There is no conversion class registered for composite conversion word [" + keyword + "]"); return null; } }
@SuppressWarnings("unchecked") DynamicConverter<E> createConverter(SimpleKeywordNode kn) { String keyword = (String) kn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (DynamicConverter) OptionHelper.instantiateByClassName( converterClassStr, DynamicConverter.class, context); } catch (Exception e) { addError("Failed to instantiate converter class [" + converterClassStr + "] for keyword ["+keyword+"]", e); return null; } } else { addError("There is no conversion class registered for conversion word [" + keyword + "]"); return null; } }
@SuppressWarnings("unchecked") DynamicConverter<E> createConverter(KeywordNode kn) { String keyword = (String) kn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (DynamicConverter) OptionHelper.instantiateByClassName( converterClassStr, DynamicConverter.class, context); } catch (Exception e) { addError("Failed to instantiate converter class [" + converterClassStr + "]", e); return null; } } else { addError("There is no conversion class registered for conversion word [" + keyword + "]"); return null; } }
@SuppressWarnings("unchecked") DynamicConverter<E> createConverter(SimpleKeywordNode kn) { String keyword = (String) kn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (DynamicConverter) OptionHelper.instantiateByClassName( converterClassStr, DynamicConverter.class, context); } catch (Exception e) { addError("Failed to instantiate converter class [" + converterClassStr + "] for keyword ["+keyword+"]", e); return null; } } else { addError("There is no conversion class registered for conversion word [" + keyword + "]"); return null; } }
@SuppressWarnings("unchecked") CompositeConverter<E> createCompositeConverter(CompositeNode cn) { String keyword = (String) cn.getValue(); String converterClassStr = (String) converterMap.get(keyword); if (converterClassStr != null) { try { return (CompositeConverter) OptionHelper.instantiateByClassName( converterClassStr, CompositeConverter.class, context); } catch (Exception e) { addError("Failed to instantiate converter class [" + converterClassStr + "] as a composite converter for keyword ["+keyword+"]", e); return null; } } else { addError("There is no conversion class registered for composite conversion word [" + keyword + "]"); return null; } }
CompositeConverter<E> compositeConverter = createCompositeConverter(cn); if(compositeConverter == null) { addError("Failed to create converter for [%"+cn.getValue()+"] keyword"); addToList(new LiteralConverter<E>("%PARSER_ERROR["+cn.getValue()+"]")); break;
CompositeConverter<E> compositeConverter = createCompositeConverter(cn); if(compositeConverter == null) { addError("Failed to create converter for [%"+cn.getValue()+"] keyword"); addToList(new LiteralConverter<E>("%PARSER_ERROR["+cn.getValue()+"]")); break;
CompositeConverter<E> compositeConverter = createCompositeConverter(cn); if(compositeConverter == null) { addError("Failed to create converter for [%"+cn.getValue()+"] keyword"); addToList(new LiteralConverter<E>("%PARSER_ERROR["+cn.getValue()+"]")); break;