Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Sign in
issue
issue
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 23
    • Issues 23
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar

新注册的用户请输入邮箱并保存,随后登录邮箱激活账号。后续可直接使用邮箱登录!

  • chainmaker
  • issueissue
  • Issues
  • #811

Closed
Open
Opened Sep 06, 2023 by Yi Yang@horatio

SDK-JAVA2.3.0和log4j2冲突

通过java-sdk构建springboot项目时,经排查发现chainmaker-sdk-java2.3.0和log4j2 2.7.4冲突了,导致项目无法启动,请问该如何解决

<!--POM-->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-log4j2</artifactId>
      <version>2.7.4</version>
    </dependency>

    <dependency>
      <groupId>org.chainmaker</groupId>
      <artifactId>chainmaker-sdk-java</artifactId>
      <version>2.3.0</version>
    </dependency>

报错内容如下

Logging system failed to initialize using configuration from 'classpath:log4j2.xml'
java.lang.IllegalStateException: Logback configuration error detected: 
ERROR in ch.qos.logback.core.joran.spi.Interpreter@3:16 - no applicable action for [Appenders], current ElementPath  is [[Configuration][Appenders]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@4:53 - no applicable action for [Console], current ElementPath  is [[Configuration][Appenders][Console]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@5:91 - no applicable action for [PatternLayout], current ElementPath  is [[Configuration][Appenders][Console][PatternLayout]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@8:14 - no applicable action for [Loggers], current ElementPath  is [[Configuration][Loggers]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@9:28 - no applicable action for [Root], current ElementPath  is [[Configuration][Loggers][Root]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@10:41 - no applicable action for [AppenderRef], current ElementPath  is [[Configuration][Loggers][Root][AppenderRef]]
	at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:179)
	at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithSpecificConfig(AbstractLoggingSystem.java:66)
	at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:57)
	at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:132)
	at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:316)
	at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:282)
	at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:240)
	at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:216)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
	at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85)
	at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66)
	at java.util.ArrayList.forEach(ArrayList.java:1259)
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120)
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114)
	at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65)
	at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:344)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295)
	at com.trustchain.SpringbootApplication.main(SpringbootApplication.java:30)
	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 org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
21:35:03.583 [restartedMain] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.IllegalStateException: java.lang.IllegalStateException: Logback configuration error detected: 
ERROR in ch.qos.logback.core.joran.spi.Interpreter@3:16 - no applicable action for [Appenders], current ElementPath  is [[Configuration][Appenders]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@4:53 - no applicable action for [Console], current ElementPath  is [[Configuration][Appenders][Console]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@5:91 - no applicable action for [PatternLayout], current ElementPath  is [[Configuration][Appenders][Console][PatternLayout]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@8:14 - no applicable action for [Loggers], current ElementPath  is [[Configuration][Loggers]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@9:28 - no applicable action for [Root], current ElementPath  is [[Configuration][Loggers][Root]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@10:41 - no applicable action for [AppenderRef], current ElementPath  is [[Configuration][Loggers][Root][AppenderRef]]
	at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:328) ~[spring-boot-2.7.2.jar:2.7.2]
	at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:282) ~[spring-boot-2.7.2.jar:2.7.2]
	at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:240) ~[spring-boot-2.7.2.jar:2.7.2]
	at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:216) ~[spring-boot-2.7.2.jar:2.7.2]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[spring-context-5.3.22.jar:5.3.22]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[spring-context-5.3.22.jar:5.3.22]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[spring-context-5.3.22.jar:5.3.22]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) ~[spring-context-5.3.22.jar:5.3.22]
	at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85) ~[spring-boot-2.7.2.jar:2.7.2]
	at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66) ~[spring-boot-2.7.2.jar:2.7.2]
	at java.util.ArrayList.forEach(ArrayList.java:1259) ~[?:1.8.0_382]
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120) ~[spring-boot-2.7.2.jar:2.7.2]
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114) ~[spring-boot-2.7.2.jar:2.7.2]
	at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65) ~[spring-boot-2.7.2.jar:2.7.2]
	at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:344) ~[spring-boot-2.7.2.jar:2.7.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) ~[spring-boot-2.7.2.jar:2.7.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-2.7.2.jar:2.7.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) ~[spring-boot-2.7.2.jar:2.7.2]
	at com.trustchain.SpringbootApplication.main(SpringbootApplication.java:30) ~[classes/:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_382]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_382]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_382]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_382]
	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.7.4.jar:2.7.4]
Caused by: java.lang.IllegalStateException: Logback configuration error detected: 
ERROR in ch.qos.logback.core.joran.spi.Interpreter@3:16 - no applicable action for [Appenders], current ElementPath  is [[Configuration][Appenders]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@4:53 - no applicable action for [Console], current ElementPath  is [[Configuration][Appenders][Console]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@5:91 - no applicable action for [PatternLayout], current ElementPath  is [[Configuration][Appenders][Console][PatternLayout]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@8:14 - no applicable action for [Loggers], current ElementPath  is [[Configuration][Loggers]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@9:28 - no applicable action for [Root], current ElementPath  is [[Configuration][Loggers][Root]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@10:41 - no applicable action for [AppenderRef], current ElementPath  is [[Configuration][Loggers][Root][AppenderRef]]
	at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:179) ~[spring-boot-2.7.2.jar:2.7.2]
	at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithSpecificConfig(AbstractLoggingSystem.java:66) ~[spring-boot-2.7.2.jar:2.7.2]
	at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:57) ~[spring-boot-2.7.2.jar:2.7.2]
	at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:132) ~[spring-boot-2.7.2.jar:2.7.2]
	at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:316) ~[spring-boot-2.7.2.jar:2.7.2]
	... 23 more
Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException
	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 org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.IllegalStateException: java.lang.IllegalStateException: Logback configuration error detected: 
ERROR in ch.qos.logback.core.joran.spi.Interpreter@3:16 - no applicable action for [Appenders], current ElementPath  is [[Configuration][Appenders]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@4:53 - no applicable action for [Console], current ElementPath  is [[Configuration][Appenders][Console]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@5:91 - no applicable action for [PatternLayout], current ElementPath  is [[Configuration][Appenders][Console][PatternLayout]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@8:14 - no applicable action for [Loggers], current ElementPath  is [[Configuration][Loggers]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@9:28 - no applicable action for [Root], current ElementPath  is [[Configuration][Loggers][Root]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@10:41 - no applicable action for [AppenderRef], current ElementPath  is [[Configuration][Loggers][Root][AppenderRef]]
	at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:328)
	at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:282)
	at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:240)
	at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:216)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
	at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85)
	at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66)
	at java.util.ArrayList.forEach(ArrayList.java:1259)
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120)
	at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114)
	at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65)
	at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:344)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295)
	at com.trustchain.SpringbootApplication.main(SpringbootApplication.java:30)
	... 5 more
Caused by: java.lang.IllegalStateException: Logback configuration error detected: 
ERROR in ch.qos.logback.core.joran.spi.Interpreter@3:16 - no applicable action for [Appenders], current ElementPath  is [[Configuration][Appenders]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@4:53 - no applicable action for [Console], current ElementPath  is [[Configuration][Appenders][Console]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@5:91 - no applicable action for [PatternLayout], current ElementPath  is [[Configuration][Appenders][Console][PatternLayout]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@8:14 - no applicable action for [Loggers], current ElementPath  is [[Configuration][Loggers]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@9:28 - no applicable action for [Root], current ElementPath  is [[Configuration][Loggers][Root]]
ERROR in ch.qos.logback.core.joran.spi.Interpreter@10:41 - no applicable action for [AppenderRef], current ElementPath  is [[Configuration][Loggers][Root][AppenderRef]]
	at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadConfiguration(LogbackLoggingSystem.java:179)
	at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithSpecificConfig(AbstractLoggingSystem.java:66)
	at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:57)
	at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:132)
	at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:316)
	... 23 more

群里说做一下依赖排除或者保持版本一致请问该如何操作呢?

Edited Sep 06, 2023 by Yi Yang
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: chainmaker/issue#811

Copyright © 2021 ChainMaker Org. All Rights Reserved. 长安链 版权所有。