最近,我从英特尔芯片Mac转到了M1 one,我无法使用Docker运行很少的服务。所有服务都是在docker-组合文件中定义的,当我启动它时,所有的Spring服务都有相同的问题。
这是我的Logback配置:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration>
<configuration scan="true">
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<springProfile name="!dev">
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_PATH}/inp_server_logFile.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>90</maxHistory>
</rollingPolicy>
<encoder>
<charset>utf-8</charset>
<Pattern>%d %-5level [%thread] %logger{0}: %msg%n</Pattern>
</encoder>
</appender>
</springProfile>
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
<queueSize>512</queueSize>
<appender-ref ref="FILE"/>
</appender>
<root level="DEBUG">
<appender-ref ref="ASYNC"/>
</root>
<logger name="javax.activation" level="WARN"/>
<logger name="javax.mail" level="WARN"/>
<logger name="javax.management.remote" level="WARN"/>
<logger name="javax.xml.bind" level="WARN"/>
<logger name="ch.qos.logback" level="WARN"/>
<logger name="com.netflix" level="WARN"/>
<logger name="com.netflix.config.sources.URLConfigurationSource" level="ERROR"/>
<logger name="com.netflix.discovery" level="INFO"/>
<logger name="com.ryantenney" level="WARN"/>
<logger name="com.sun" level="WARN"/>
<logger name="com.zaxxer" level="WARN"/>
<logger name="io.undertow" level="WARN"/>
<logger name="io.undertow.websockets.jsr" level="ERROR"/>
<logger name="org.apache" level="WARN"/>
<logger name="org.apache.kafka" level="INFO"/>
<logger name="org.apache.catalina.startup.DigesterFactory" level="OFF"/>
<logger name="org.bson" level="WARN"/>
<logger name="org.hibernate.validator" level="WARN"/>
<logger name="org.mongodb.driver" level="WARN"/>
<logger name="pl.inpeak" level="WARN"/>
<logger name="org.reflections" level="WARN"/>
<logger name="org.springframework" level="WARN"/>
<logger name="org.springframework.web" level="WARN"/>
<logger name="org.springframework.security" level="WARN"/>
<logger name="org.springframework.cache" level="WARN"/>
<logger name="org.thymeleaf" level="WARN"/>
<logger name="org.xnio" level="WARN"/>
<logger name="springfox" level="WARN"/>
<logger name="sun.rmi" level="WARN"/>
<logger name="springfox.documentation.schema.property" level="ERROR"/>
<logger name="sun.rmi.transport" level="WARN"/>
<!-- https://logback.qos.ch/manual/configuration.html#shutdownHook and https://jira.qos.ch/browse/LOGBACK-1090 -->
<shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook"/>
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>
</configuration>这就是控制台输出的错误:
server_1 | Logging system failed to initialize using configuration from 'null'
server_1 | java.lang.IllegalStateException: Logback configuration error detected:
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@8:87 - no applicable action for [appender], current ElementPath is [[configuration][springProfile][appender]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@9:87 - no applicable action for [rollingPolicy], current ElementPath is [[configuration][springProfile][appender][rollingPolicy]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@10:34 - no applicable action for [fileNamePattern], current ElementPath is [[configuration][springProfile][appender][rollingPolicy][fileNamePattern]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@11:29 - no applicable action for [maxHistory], current ElementPath is [[configuration][springProfile][appender][rollingPolicy][maxHistory]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@13:22 - no applicable action for [encoder], current ElementPath is [[configuration][springProfile][appender][encoder]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@14:26 - no applicable action for [charset], current ElementPath is [[configuration][springProfile][appender][encoder][charset]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@15:26 - no applicable action for [Pattern], current ElementPath is [[configuration][springProfile][appender][encoder][Pattern]]
server_1 | at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:179)
server_1 | at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:80)
server_1 | at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:60)
server_1 | at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:132)
server_1 | at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:313)
server_1 | at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:282)
server_1 | at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:240)
server_1 | at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:216)
server_1 | at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
server_1 | at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
server_1 | at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
server_1 | at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
server_1 | at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)
server_1 | at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:63)
server_1 | at java.base/java.util.ArrayList.forEach(Unknown Source)
server_1 | at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
server_1 | at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
server_1 | at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62)
server_1 | at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:374)
server_1 | at org.springframework.boot.SpringApplication.run(SpringApplication.java:332)
server_1 | at pl.inpeak.InpeakServerApp$Companion.main(InpeakServerApp.kt:77)
server_1 | at pl.inpeak.InpeakServerApp.main(InpeakServerApp.kt)
server_1 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
server_1 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
server_1 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
server_1 | at java.base/java.lang.reflect.Method.invoke(Unknown Source)
server_1 | at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
server_1 | 2021-08-09 12:27:20.904 ERROR 1 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed
server_1 |
server_1 | java.lang.IllegalStateException: java.lang.IllegalStateException: Logback configuration error detected:
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@8:87 - no applicable action for [appender], current ElementPath is [[configuration][springProfile][appender]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@9:87 - no applicable action for [rollingPolicy], current ElementPath is [[configuration][springProfile][appender][rollingPolicy]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@10:34 - no applicable action for [fileNamePattern], current ElementPath is [[configuration][springProfile][appender][rollingPolicy][fileNamePattern]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@11:29 - no applicable action for [maxHistory], current ElementPath is [[configuration][springProfile][appender][rollingPolicy][maxHistory]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@13:22 - no applicable action for [encoder], current ElementPath is [[configuration][springProfile][appender][encoder]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@14:26 - no applicable action for [charset], current ElementPath is [[configuration][springProfile][appender][encoder][charset]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@15:26 - no applicable action for [Pattern], current ElementPath is [[configuration][springProfile][appender][encoder][Pattern]]
server_1 | at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:328)
server_1 | at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:282)
server_1 | at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:240)
server_1 | at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:216)
server_1 | at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
server_1 | at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
server_1 | at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
server_1 | at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
server_1 | at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)
server_1 | at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:63)
server_1 | at java.base/java.util.ArrayList.forEach(Unknown Source)
server_1 | at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
server_1 | at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
server_1 | at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62)
server_1 | at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:374)
server_1 | at org.springframework.boot.SpringApplication.run(SpringApplication.java:332)
server_1 | at pl.inpeak.InpeakServerApp$Companion.main(InpeakServerApp.kt:77)
server_1 | at pl.inpeak.InpeakServerApp.main(InpeakServerApp.kt)
server_1 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
server_1 | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
server_1 | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
server_1 | at java.base/java.lang.reflect.Method.invoke(Unknown Source)
server_1 | at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
server_1 | Caused by: java.lang.IllegalStateException: Logback configuration error detected:
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@8:87 - no applicable action for [appender], current ElementPath is [[configuration][springProfile][appender]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@9:87 - no applicable action for [rollingPolicy], current ElementPath is [[configuration][springProfile][appender][rollingPolicy]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@10:34 - no applicable action for [fileNamePattern], current ElementPath is [[configuration][springProfile][appender][rollingPolicy][fileNamePattern]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@11:29 - no applicable action for [maxHistory], current ElementPath is [[configuration][springProfile][appender][rollingPolicy][maxHistory]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@13:22 - no applicable action for [encoder], current ElementPath is [[configuration][springProfile][appender][encoder]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@14:26 - no applicable action for [charset], current ElementPath is [[configuration][springProfile][appender][encoder][charset]]
server_1 | ERROR in ch.qos.logback.core.joran.spi.Interpreter@15:26 - no applicable action for [Pattern], current ElementPath is [[configuration][springProfile][appender][encoder][Pattern]]
server_1 | at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:179)
server_1 | at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:80)
server_1 | at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:60)
server_1 | at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:132)
server_1 | at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:313)
server_1 | ... 22 common frames omitted
server_1 |
server_1 exited with code 0除了这款苹果M1芯片,一切都很好。这个登录配置可能是错误的吗?
发布于 2021-08-09 12:37:41
假设您正在运行Mac的docker桌面,您检查过:https://docs.docker.com/docker-for-mac/apple-silicon/吗?您需要下载预览版,以便docker在M1上工作。
发布于 2021-08-31 03:32:17
尝试在ARM64中运行本机,构建一个arm64坞映像。
参见我回答的类似问题:https://stackoverflow.com/a/68992222/7870598
https://stackoverflow.com/questions/68712144
复制相似问题