Try to execute uberjar using "java -jar" =>IllegalStateException: Unknown tag! pos=4 poolCount = 32

2,988 views
Skip to first unread message

Kuryeux

unread,
Aug 12, 2018, 7:10:59 PM8/12/18
to Thorntail
I get the exception below after using the HOWTO instructions given at http://docs.wildfly-swarm.io/2.0.0.Final/


java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.wildfly.swarm.bootstrap.MainInvoker.invoke(MainInvoker.java:53)
        at org.wildfly.swarm.bootstrap.Main.run(Main.java:132)
        at org.wildfly.swarm.bootstrap.Main.main(Main.java:85)
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Unknown tag! pos=4 poolCount = 32
        at org.wildfly.swarm.Swarm.initializeConfigView(Swarm.java:635)
        at org.wildfly.swarm.Swarm.<init>(Swarm.java:254)
        at org.wildfly.swarm.Swarm.<init>(Swarm.java:192)
        at org.wildfly.swarm.Swarm.<init>(Swarm.java:179)
        at org.wildfly.swarm.Swarm.main(Swarm.java:739)

Relevant parts the pom.xml

<properties>
<version.wildfly.swarm>2.0.0.Final</version.wildfly.swarm>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<failOnMissingWebXml>false</failOnMissingWebXml>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.thorntail>2.0.0.Final</version.thorntail>
<kafka.version>2.0.0</kafka.version>
<!--<swarm.hollow>true</swarm.hollow>-->
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>bom</artifactId>
<version>${version.wildfly.swarm}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- Wildfly Swarm Fractions -->
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>jaxrs</artifactId>
</dependency>

<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-streams</artifactId>
<version>${kafka.version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-slf4j-impl -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.11.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.thorntail/cdi -->
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>cdi</artifactId>
<version>${version.thorntail}</version>
</dependency>

</dependencies>

<build>
<finalName>kafka-producer</finalName>
<plugins>
<plugin>
<groupId>io.thorntail</groupId>
<artifactId>thorntail-maven-plugin</artifactId>
<version>${version.wildfly.swarm}</version>
<executions>
<execution>
<id>package</id>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>openshift</id>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>resource</goal>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

Ken Finnigan

unread,
Aug 13, 2018, 8:24:33 AM8/13/18
to Thorntail
Do you have a project-defaults.yml for the project? If you do, is it empty? I think I've seen this error when the file is empty

Ken

Justin Jeremie

unread,
Aug 13, 2018, 11:50:50 AM8/13/18
to Ken Finnigan, thor...@googlegroups.com
Hello Ken,
   Thanks for the prompt reply. I have added a config file containing the entries listed below and ran the uberjar using the following command: java -jar -Dswarm.project.stage.file=src/main/resources/project-defaults.yml  target\kafka-producer-thorntail.jar. However that did not make a difference.

swarm:

bind:
address: 127.0.0.1

Regards,
   Justin


--
You received this message because you are subscribed to the Google Groups "Thorntail" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thorntail+...@googlegroups.com.
To post to this group, send email to thor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/thorntail/adfaf834-18e3-44d9-937b-088804b4ce23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michał Szynkiewicz

unread,
Aug 14, 2018, 1:43:00 AM8/14/18
to Thorntail
Justin, by any chance, does the stack trace contain one more "caused by" section?

I saw a similar error message when using old version of Jandex with jars built with Java 9 but looking at the Thorntail code and your dependencies I'm not sure it may be the case.

Justin Jeremie

unread,
Aug 14, 2018, 6:30:13 AM8/14/18
to mszy...@redhat.com, thor...@googlegroups.com
Michal,
  Please see the complete stack trace below. Thanks.
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.wildfly.swarm.bootstrap.MainInvoker.invoke(MainInvoker.java:53)
        at org.wildfly.swarm.bootstrap.Main.run(Main.java:132)
        at org.wildfly.swarm.bootstrap.Main.main(Main.java:85)
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Unknown tag! pos=4 poolCount = 32
        at org.wildfly.swarm.Swarm.initializeConfigView(Swarm.java:635)
        at org.wildfly.swarm.Swarm.<init>(Swarm.java:254)
        at org.wildfly.swarm.Swarm.<init>(Swarm.java:192)
        at org.wildfly.swarm.Swarm.<init>(Swarm.java:179)
        at org.wildfly.swarm.Swarm.main(Swarm.java:739)
        ... 7 more
Caused by: 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.wildfly.swarm.Swarm.initializeConfigFiltersFatJar(Swarm.java:657)
        at org.wildfly.swarm.Swarm.initializeConfigFilters(Swarm.java:641)
        at org.wildfly.swarm.Swarm.initializeConfigView(Swarm.java:632)
        ... 11 more
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.wildfly.swarm.bootstrap.MainInvoker.invoke(MainInvoker.java:53)
        at org.wildfly.swarm.bootstrap.Main.run(Main.java:132)
        at org.wildfly.swarm.bootstrap.Main.main(Main.java:85)
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Unknown tag! pos=4 poolCount = 32
        at org.wildfly.swarm.Swarm.initializeConfigView(Swarm.java:635)
        at org.wildfly.swarm.Swarm.<init>(Swarm.java:254)
        at org.wildfly.swarm.Swarm.<init>(Swarm.java:192)
        at org.wildfly.swarm.Swarm.<init>(Swarm.java:179)
        at org.wildfly.swarm.Swarm.main(Swarm.java:739)
        ... 7 more
Caused by: 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.wildfly.swarm.Swarm.initializeConfigFiltersFatJar(Swarm.java:657)
        at org.wildfly.swarm.Swarm.initializeConfigFilters(Swarm.java:641)
        at org.wildfly.swarm.Swarm.initializeConfigView(Swarm.java:632)
        ... 11 more



Regards,
   Justin


Michał Szynkiewicz

unread,
Aug 14, 2018, 6:52:34 AM8/14/18
to Thorntail
Justin, thanks for the full stack trace.

It seems Jandex (the library we use to scan classes) has trouble parsing one of the classes.

Could you debug your app, put a breakpoint at Indexer:1417 and check on which class it is failing?

To debug the app you can run:
 java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 -jar <your jar> 
and attach a remote debugger from your IDE to localhost port 5005

Regards, 
Michał

Michał Szynkiewicz

unread,
Aug 16, 2018, 6:42:15 AM8/16/18
to Thorntail
The Thorntail class that invokes Jandex is in io.thorntail:container:<your-thorntail-version>
Jandex is from org.jboss:jandex:2.0.3.Final
Reply all
Reply to author
Forward
0 new messages