Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Log4j 2.16.0 java 8

Tags:

java

log4j

Due the issue on log4j (CVE-2021-44228) I migrate some apps to log4j 2.15.0 (using JBoss EAP 7.1 with jdk 1.8.0_211-b12) without any issues. I'd like now to migrate from log4j 2.15.0 to 2.16.0.

When I try it I've the following error

 15:20:59,361 WARN [org.jboss.as.server.deployment] (MSC service thread
 1-8) WFLYSRV0003: Could not index class
 META-INF/versions/9/module-info.class  at
 /C:/jboss-eap-7.1/standalone/deployments/myApp-SNAPSHOT.war/WEB-INF/lib/log4j-api-2.16.0.jar:
 java.lang.IllegalStateException: Unknown tag! pos=4 poolCount = 32 at
 org.jboss.jandex.Indexer.processConstantPool(Indexer.java:1417) at
 org.jboss.jandex.Indexer.index(Indexer.java:1451) at
 org.jboss.as.server.deployment.annotation.ResourceRootIndexer.indexResourceRoot(ResourceRootIndexer.java:99)
 at
 org.jboss.as.server.deployment.annotation.AnnotationIndexProcessor.deploy(AnnotationIndexProcessor.java:51)
 at
 org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
 at
 org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
 at
 org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
 at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 at java.lang.Thread.run(Thread.java:748)

It seems related with java version, especially because it's working for JBoss EAP 7.3 with jdk 11 but the official documentation says

"Log4j 2.16.0 is the latest release of Log4j. As of Log4j 2.13.0 Log4j 2 requires Java 8 or greater at runtime. This release contains new features and fixes which can be found in the latest changes report."

https://logging.apache.org/log4j/2.x/index.html

Anyone with the same problem?

Edit: After rebuild all the porject I realize that this stack wasn't causing the crash. Since it's a warning I'll just ignore it

like image 229
JMarques Avatar asked Aug 14 '26 13:08

JMarques


1 Answers

I had same problem with log4j 2.16.0 and WildFly 10.1. I tried to update WildFly from 10.1 to 13.0 and resolved that error.

The problem have been fixed on WildFly 13.0 ( https://issues.redhat.com/browse/WFLY-9608 ).

It seems that JBoss EAP 7.2 is equivalent to WildFly 14.0.

http://www.mastertheboss.com/jbossas/jboss-eap/what-is-the-difference-between-jboss-eap-wildfly-and-jboss-as/

So you should update JBoss EAP newer than 7.2.

like image 58
Wataru Avatar answered Aug 17 '26 02:08

Wataru



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!