我正在尝试将弹性搜索与websphere 8.5一起使用。我添加了一些日志依赖项,如
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.24</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>1.6.1</version>
<type>jar</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>0.9.28</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>0.9.28</version>
</dependency>
当我启动服务器时出现此错误
[05/01/18 16:38:41:894 WET] 0000005c ecs W com.ibm.ws.ecs.internal.scan.context.impl.ScannerContextImpl scanJAR unable to open input stream for resource META-INF/versions/9/org/apache/logging/log4j/util/StackLocator.class in archive WEB-INF/lib/log4j-api-2.9.1.jar
java.lang.IllegalArgumentException
感谢您的帮助
答案 0 :(得分:0)
您应该能够使用此IBM KnowledgeCenter topic中的说明从WebSphere注释处理中排除log4 jar。
答案 1 :(得分:0)
修改服务器属性 Ignore-Scanning-Archives ,以忽略此库的scanJar。
有2种不同的方法可以做到这一点:
Ignore-Scanning-Archives = log4j-api-2.9.1.jar
<plugin> <artifactId>maven-ear-plugin</artifactId> ... <manifestEntries> <Ignore-Scanning-Archives>log4j-api-2.9.1.jar</Ignore-Scanning-Archives>