22

We have updated log4j jar from log4j-api-2.7.jar to log4j-api-2.10.0.jar. We are getting below warning at the startup of JBoss(we are using JBoss-EAP-7.0).

2018-09-05 05:31:28,669 WARN [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0003: Could not index class module-info.class at /content/project.ear/shared/log4j-api.jar: java.lang.IllegalStateException: Unknown tag! pos=4 poolCount = 24 at org.jboss.jandex.Indexer.processConstantPool(Indexer.java:1416) at org.jboss.jandex.Indexer.index(Indexer.java:1450) 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)

After my analysis it seems that module-info.class is newly introduced in log4j-api-2.10.0.jar and now it is not able to index that class on startup. It is using JBoss's jandex-2.0.2.Final-redhat-1.jar for the same which is coming from dependency information of eap-runtime-artifacts-7.0.5.GA.pom.

Can anyone please help me to resolve this issue?

Thanks in Advance.

htshame
  • 6,599
  • 5
  • 36
  • 56
prashant
  • 221
  • 1
  • 2
  • 4

2 Answers2

13

First of all this is only a warning.

I guess you are using a Java Version lower than 8 9. The module-info.class is used for so called Multi release jar's (jars that are comptible with all java version).

Java until Version 8 9 are not 100% compatible with this technique. So the only way i see is upgrade your Java Version to 1.8 9 or downgrade log4j

Ahmed Sayed
  • 452
  • 1
  • 8
  • 15
Jens
  • 67,715
  • 15
  • 98
  • 113
  • 1
    We are using JDK 1.8 only and if we downgrade the version log4j to previous version i.e. 2.7 then we are getting errors as NoSuchMethodFoundException. – prashant Sep 05 '18 at 11:28
  • 3
    I think that is my fault. Multi release jars was introduced in java9 – Jens Sep 05 '18 at 11:35
  • 2
    I change my wildfly server from wildfly10.1.0 to wildfly-15.0.1 and it works fine. – Shalika Apr 11 '19 at 08:37
  • I had got similar issue even with Java 8 + WildFly 14. I had just upgraded the json.jar and this issue was fixed. – Jimmy Aug 18 '21 at 05:41
3

This is a warning message, it occured because of jandex supports Java9 is to simply ignore module-info.class files in dependent archives. To avoid this warning messages, replace jandex jar present in (wildfly_HOME\modules\system\layers\base\org\jboss\jandex\main\jande-version.jar with jandex-2.0.5.Final-redhat-1 and the respective module.xml also. Ref : https://issues.redhat.com/browse/JBEAP-15262 https://issues.redhat.com/browse/JBEAP-15715

  • I got this warning with JBoss EAP 7. The `jandex-2.1.0.Final.jar` also worked for me. I replaced jandex and updated the module.xml file. jandex: https://mvnrepository.com/artifact/org.jboss/jandex – Dhanusha_Perera07 Mar 20 '23 at 15:00