question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid classfile: Unknown constant pool tag 17 (element size unknown, cannot continue reading class)

See original GitHub issue

Java version: JDK 11.0.11 ClassGraph version: 4.8.47

Hey, I found a really tricky issue in our team code when we tried to upgrade from JDK8 to JDK11.

The error as in the title happened when we tried to scan the classes under certain package prefix. Below is the code we run and the error logs.

ScanResult result = new ClassGraph().enableAllInfo().verbose()
                .whitelistPackages(prefix).scan();  
[java] 2021-06-06T16:58:06.424-0400	ClassGraph	------------ Found classfile within whitelisted package: s3/heart/activities/ExecutionEnvironment.class
[java] 2021-06-06T16:58:06.517-0400	ClassGraph	-------------- Parsing classfile (took 0.008992 sec)
[java] 2021-06-06T16:58:06.526-0400	ClassGraph	---------------- Invalid classfile: Unknown constant pool tag 17 (element size unknown, cannot continue reading class). Please report this at https://github.com/classgraph/classgraph/issues

The tricky thing is, it only happened when we tried to use JDK11 and scan cross Jars. It works totally fine if we are using JDK8 or if we only scan inside the same jar which ClassGraph sits. Wondering do you have any clue? If it requires to upgrade ClassGraph, we need to talk to other teams to do it. Anything we can try out before that? Thanks!

Best

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
haoyufcommented, Jun 11, 2021

Hey, Luke. Just FYI. Your commit fixed the issue!

1reaction
haoyufcommented, Jun 7, 2021

Thanks a lot, this is really quick reply! I would like to try version 4.8.108!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Throw Unknown constant pool tag when upgrade to 2.10.0
RuntimeException: Unknown constant pool tag [I@d105805e in classfile module-info.class (element size unknown, cannot continue reading class.
Read more >
Corda 3: java.lang.RuntimeException: Unknown constant pool ...
RuntimeException: Unknown constant pool tag [I@4b4ed4ba in classfile module-info.class (element size unknown, cannot continue reading class.
Read more >
Failed to scan the classpath Unknown constant pool tag for ...
RuntimeException: Unknown constant pool tag [I@ee0b393 in classfile module-info.class (element size unknown, cannot continue reading class.
Read more >
Unknown constant pool entry tag at offset Error message ... - IBM
This issue occurs if the class file was compiled with Java version on Windows XP (32 bit) machine and executed on Windows 2003...
Read more >
Chapter 4. The class File Format - Oracle Help Center
This chapter describes the Java Virtual Machine class file format. ... In retrospect, making 8-byte constants take two constant pool entries was a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found