4

i am creating one webservice and getting error like

org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19.

i am using tomcat 8.0 and java versoin is 1.8.0.152.

Ruslan López
  • 4,433
  • 2
  • 26
  • 37
Vishal
  • 121
  • 1
  • 2
  • 12
  • 3
    Possible duplicate of [Tomcat 7 - Servlet 3.0: Invalid byte tag in constant pool](https://stackoverflow.com/questions/6751920/tomcat-7-servlet-3-0-invalid-byte-tag-in-constant-pool) – Thomas Flinkow May 28 '18 at 13:57

1 Answers1

15

A constant pool entry with tag type 19 is a module descriptor; see JVM spec table 4.4-A. I think you have attempted to use BCEL on a class compiled with a Java 9 (or later) compiler:

  • The BCEL version you are using doesn't understand the tag.
  • The class wouldn't load in a Java 8 JVM anyway. Modules were only introduced in Java 9, and the class file's major version number should be too recent for a Java 8 JVM.
Stephen C
  • 698,415
  • 94
  • 811
  • 1,216