Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when indexing guava-30.0-jre #93

Closed
bennypi opened this issue Oct 30, 2020 · 7 comments
Closed

Exception when indexing guava-30.0-jre #93

bennypi opened this issue Oct 30, 2020 · 7 comments

Comments

@bennypi
Copy link

bennypi commented Oct 30, 2020

jandex is not capable of parsing the current guava release, guava-30.0-jre. It fails when indexing ClosingFuture.class.
Please see the stacktrace:

java -jar ~/.m2/repository/org/jboss/jandex/2.2.1.Final/jandex-2.2.1.Final.jar ~/.m2/repository/com/google/guava/guava/30.0-jre/guava-30.0-jre.jar
ERROR: Could not index com/google/common/util/concurrent/ClosingFuture.class: Class extends type annotation appeared on a non class target
java.lang.IllegalStateException
	at org.jboss.jandex.IndexWriterV2$ReferenceTable.getReferenceEntry(IndexWriterV2.java:125)
	at org.jboss.jandex.IndexWriterV2$ReferenceTable.positionOf(IndexWriterV2.java:132)
	at org.jboss.jandex.IndexWriterV2.positionOf(IndexWriterV2.java:448)
	at org.jboss.jandex.IndexWriterV2.writeTypeTargetFields(IndexWriterV2.java:381)
	at org.jboss.jandex.IndexWriterV2.writeTypeTarget(IndexWriterV2.java:366)
	at org.jboss.jandex.IndexWriterV2.writeAnnotationTarget(IndexWriterV2.java:335)
	at org.jboss.jandex.IndexWriterV2.writeAnnotation(IndexWriterV2.java:319)
	at org.jboss.jandex.IndexWriterV2.writeReferenceOrFull(IndexWriterV2.java:614)
	at org.jboss.jandex.IndexWriterV2.writeClassEntry(IndexWriterV2.java:537)
	at org.jboss.jandex.IndexWriterV2.writeClasses(IndexWriterV2.java:472)
	at org.jboss.jandex.IndexWriterV2.write(IndexWriterV2.java:207)
	at org.jboss.jandex.IndexWriter.write(IndexWriter.java:107)
	at org.jboss.jandex.IndexWriter.write(IndexWriter.java:74)
	at org.jboss.jandex.JarIndexer.createJarIndex(JarIndexer.java:193)
	at org.jboss.jandex.JarIndexer.createJarIndex(JarIndexer.java:86)
	at org.jboss.jandex.Main.getIndex(Main.java:87)
	at org.jboss.jandex.Main.execute(Main.java:68)
	at org.jboss.jandex.Main.main(Main.java:53)

I became aware of this problem because a deployment of mine is using this version of guava, and when I deploy the EAR in to JBoss EAP 7.3.2, a warning with a similar stacktrace is thrown. The version of jandex in the JBoss is jandex-2.1.2.Final-redhat-00001, however this problem still exists with the 2.2.1 release.

@n1hility
Copy link
Contributor

n1hility commented Nov 1, 2020

@bennypi thanks for the report. This is an unusual one, but I will get this fixed quickly.

n1hility added a commit that referenced this issue Nov 11, 2020
Ignore bogus type annotation entries - Fixes #93
@n1hility
Copy link
Contributor

@bennypi this is fixed in 2.2.2.Final and 2.1.4.Final. It may take 24 hours for the release to sync to maven central

@melloware
Copy link

I can confirm i was getting this error in Eclipse with Gauva 30. I replaced jandex 2.1.2 in Eclipse with 2.1.4 and the error is resolved. Thank you!

@DustInComp
Copy link

Had the same problem with guava 30.0-jre as a transitive dependency of jwks-rsa. What worked for me was overriding the transitive dependency with version 30.1-jre:

<!-- https://mvnrepository.com/artifact/com.auth0/jwks-rsa -->
<dependency>
  <groupId>com.auth0</groupId>
  <artifactId>jwks-rsa</artifactId>
  <version>0.15.0</version>
  <exclusions>
    <exclusion>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </exclusion>
  </exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
  <groupId>com.google.guava</groupId>
  <artifactId>guava</artifactId>
  <version>30.1-jre</version>
</dependency>

@melloware
Copy link

So the issue is fixed in 30.1 ?

@DustInComp
Copy link

Seems like it. Though, they don't address it in the changelog and I can't tell what change to ClosingFuture.java fixed it from the diff.

@melloware
Copy link

Well that is good news. It was driving me nuts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants