Use of Lambda Expressions in EAP 6.3.3 logs WARN JBAS015852: Could not index class ... Unknown tag!
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 6.3.3
- Java 8
- Lambda Expressions
Issue
- If a deployment is compiled with Java 8 and uses classes that use Lambda's (a Java 8 feature), it will log a warning
16:00:00,215 WARN [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015852: Could not index class com/jboss/examples/servlet/Shopper.class at /content/test.war/WEB-INF/classes: java.lang.IllegalStateException: Unknown tag! pos=4 poolCount = 92
at org.jboss.jandex.Indexer.processConstantPool(Indexer.java:606) [jandex-1.0.3.Final-redhat-2.jar:1.0.3.Final-redhat-2]
at org.jboss.jandex.Indexer.index(Indexer.java:640) [jandex-1.0.3.Final-redhat-2.jar:1.0.3.Final-redhat-2]
at org.jboss.as.server.deployment.annotation.ResourceRootIndexer.indexResourceRoot(ResourceRootIndexer.java:100) [jboss-as-server-7.4.3.Final-redhat-2.jar:7.4.3.Final-redhat-2]
at org.jboss.as.server.deployment.annotation.AnnotationIndexProcessor.deploy(AnnotationIndexProcessor.java:51) [jboss-as-server-7.4.3.Final-redhat-2.jar:7.4.3.Final-redhat-2]
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [jboss-as-server-7.4.3.Final-redhat-2.jar:7.4.3.Final-redhat-2]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
- I cannot deploy a CDI Managed Bean with a Lambda expression
- I modified the Helloword example from the quickstart and changed the HelloService class to use a lambda expression. The modified application cannot be deployed. The following exception is thrown
14:48:51,644 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015852: Could not index class org/jboss/as/quickstarts/helloworld/HelloService.class at /opt/eap-6.3.3/bin/content/jboss-helloworld.war/WEB-INF/classes: java.lang.IllegalStateException: Unknown tag! pos=25 poolCount = 82
at org.jboss.jandex.Indexer.processConstantPool(Indexer.java:606) [jandex-1.0.3.Final-redhat-2.jar:1.0.3.Final-redhat-2]
at org.jboss.jandex.Indexer.index(Indexer.java:640) [jandex-1.0.3.Final-redhat-2.jar:1.0.3.Final-redhat-2]
at org.jboss.as.server.deployment.annotation.ResourceRootIndexer.indexResourceRoot(ResourceRootIndexer.java:100) [jboss-as-server-7.4.3.Final-redhat-2.jar:7.4.3.Final-redhat-2]
at org.jboss.as.server.deployment.annotation.AnnotationIndexProcessor.deploy(AnnotationIndexProcessor.java:51) [jboss-as-server-7.4.3.Final-redhat-2.jar:7.4.3.Final-redhat-2]
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [jboss-as-server-7.4.3.Final-redhat-2.jar:7.4.3.Final-redhat-2]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
Resolution
This known issue is being tracked by This content is not included.Bug 1193113. See Known Issues with Java 8 and EAP 6.3.3 for details, workaround instructions, and planned fix information.
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.