Discussion:
Servlet 3.0 Specific Error: Invalid byte tag in constant pool
Matthew Tyson
2011-07-20 02:55:46 UTC
Permalink
Hey guys,

tomcat 7.0.19
Java 1.6.0_22
CentOS 5.6

I just switched the web.xml to servlet 3.0 (from a app running servlet 2.4
previously without issue) and now I'm seeing the following error (turned on
fine logging in the util class):
FINE: Scanning JAR [file:/usr/java/jdk1.6.0_22/jre/lib/ext/jcharset.jar]
from classpath
Jul 19, 2011 10:04:40 AM org.apache.catalina.startup.HostConfig
deployDirectory
SEVERE: Error deploying web application directory ROOT
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag
in constant pool: 60


Thanks,

Matt
Mark Thomas
2011-07-20 08:21:21 UTC
Permalink
Post by Matthew Tyson
Hey guys,
tomcat 7.0.19
Java 1.6.0_22
CentOS 5.6
I just switched the web.xml to servlet 3.0 (from a app running servlet 2.4
previously without issue) and now I'm seeing the following error (turned on
FINE: Scanning JAR [file:/usr/java/jdk1.6.0_22/jre/lib/ext/jcharset.jar]
from classpath
Jul 19, 2011 10:04:40 AM org.apache.catalina.startup.HostConfig
deployDirectory
SEVERE: Error deploying web application directory ROOT
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag
in constant pool: 60
That might be a BCEL bug or could be a corrupted JAR. Just add it to the
jarsToSkip property in catalina.properties.

Also, if you open a bugzilla issue, someone will take a closer look.

Mark
Matthew Tyson
2011-07-20 18:43:15 UTC
Permalink
Adding that to the skip list definitely prevented that error, but I'm
getting many jars with the same problem. I thought I could maybe get away
with just skipping them all, but I'm starting to see some jars that have
taglibs in them (and so need to be scanned).

All these jars are giving the same error:

,asm.jar,jboss-cache.jar,backport-util-concurrent.jar,struts-tiles-1.3.5.jar,shared-ldap-0.9.5.5.jar,jniwrap-3.6.jar,org.osgi.core-4.1.0.jar,fontbox-1.6.0.jar,apacheds-server-jndi-1.0.2.jar,apacheds-protocol-ldap-1.0.2.jar,jetm-1.2.2.jar,gdata-contacts-meta-3.0.jar,standard.jar,xbean-spring-2.8.jar,custom_rhino.jar,apacheds-server-ssl-1.0.2.jar,poi-ooxml-schemas-3.8-beta2-20110408.jar,commons-cli-1.2.jar,gdata-contacts-3.0.jar,webservices-rt.jar,iText-2.1.7.jar,javassist-3.9.0.GA.jar,mime-util-2.1.3.jar,jcaptcha-all-1.0-RC3.jar,ical4j-1.0-rc3-SNAPSHOT.jar,tomcat-jdbc.jar,dnsns.jar,jcharset.jar,pager-taglib.jar

Any ideas?

Thanks,

Matt
Post by Mark Thomas
Post by Matthew Tyson
Hey guys,
tomcat 7.0.19
Java 1.6.0_22
CentOS 5.6
I just switched the web.xml to servlet 3.0 (from a app running servlet
2.4
Post by Matthew Tyson
previously without issue) and now I'm seeing the following error (turned
on
Post by Matthew Tyson
FINE: Scanning JAR [file:/usr/java/jdk1.6.0_22/jre/lib/ext/jcharset.jar]
from classpath
Jul 19, 2011 10:04:40 AM org.apache.catalina.startup.HostConfig
deployDirectory
SEVERE: Error deploying web application directory ROOT
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte
tag
Post by Matthew Tyson
in constant pool: 60
That might be a BCEL bug or could be a corrupted JAR. Just add it to the
jarsToSkip property in catalina.properties.
Also, if you open a bugzilla issue, someone will take a closer look.
Mark
---------------------------------------------------------------------
Konstantin Kolinko
2011-07-20 19:43:30 UTC
Permalink
Post by Matthew Tyson
Adding that to the skip list definitely prevented that error, but I'm
getting many jars with the same problem.  I thought I could maybe get away
with just skipping them all, but I'm starting to see some jars that have
taglibs in them (and so need to be scanned).
1. Are you using Tomcat downloaded from tomcat.apache.org?

2. Where that JDK 1.6.0_22 is from? What is shown by `java -version`?

3. Maybe if you enable debug logging in "org.apache.tomcat.util.bcel"
you will able to provide some context where the issue happens?

Best regards,
Konstantin Kolinko
Matthew Tyson
2011-07-20 20:37:05 UTC
Permalink
java -version:

java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode)

We just upgraded it from 1.6.0_22 to see if it would address this problem
(it didn't).
Post by Konstantin Kolinko
1. Are you using Tomcat downloaded from tomcat.apache.org?
Yes.
Post by Konstantin Kolinko
3. Maybe if you enable debug logging in "org.apache.tomcat.util.bcel"
you will able to provide some context where the issue happens?
Did that - its actually how I got the name of the files failing.

Thanks for taking a look.

Matt
Post by Konstantin Kolinko
Post by Matthew Tyson
Adding that to the skip list definitely prevented that error, but I'm
getting many jars with the same problem. I thought I could maybe get
away
Post by Matthew Tyson
with just skipping them all, but I'm starting to see some jars that have
taglibs in them (and so need to be scanned).
2. Where that JDK 1.6.0_22 is from? What is shown by `java -version`?
3. Maybe if you enable debug logging in "org.apache.tomcat.util.bcel"
you will able to provide some context where the issue happens?
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
Mark Thomas
2011-07-20 20:41:37 UTC
Permalink
Post by Matthew Tyson
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode)
We just upgraded it from 1.6.0_22 to see if it would address this problem
(it didn't).
Are you sure that is the version of Java that Tomcat is starting with?

Mark
Post by Matthew Tyson
Post by Konstantin Kolinko
1. Are you using Tomcat downloaded from tomcat.apache.org?
Yes.
Post by Konstantin Kolinko
3. Maybe if you enable debug logging in "org.apache.tomcat.util.bcel"
you will able to provide some context where the issue happens?
Did that - its actually how I got the name of the files failing.
Thanks for taking a look.
Matt
Post by Konstantin Kolinko
Post by Matthew Tyson
Adding that to the skip list definitely prevented that error, but I'm
getting many jars with the same problem. I thought I could maybe get
away
Post by Matthew Tyson
with just skipping them all, but I'm starting to see some jars that have
taglibs in them (and so need to be scanned).
2. Where that JDK 1.6.0_22 is from? What is shown by `java -version`?
3. Maybe if you enable debug logging in "org.apache.tomcat.util.bcel"
you will able to provide some context where the issue happens?
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
Konstantin Kolinko
2011-07-20 21:02:51 UTC
Permalink
Invalid byte tag in constant pool: 60
The above message is created by
o.a.tomcat.util.bcel.classfile.Constant#readConstant(...). There is a
switch() and default: label results in this exception being thrown.
Expected values there are from 1 to 12. Your 60 is far outside the
range.
Post by Konstantin Kolinko
3. Maybe if you enable debug logging in "org.apache.tomcat.util.bcel"
you will able to provide some context where the issue happens?
Did that - its actually how I got the name of the files failing.
I hoped to see some information about what class files in those jars
BCEL tries to scan when it fails.

Call hierarchy is
bcel.classfile.Constant#readConstant(...)
<- bcel.classfile.ConstantPool#ConstantPool(stream)
<- bcel.classfile.ClassParser#readConstantPool()
<- bcel.classfile.parse()
<- o.a.catalina.startup.ContextConfig#processAnnotationsStream(stream, webxml)

Unfortunately there is no debug printing in ContextConfig, and
ClassParser operates on a stream and so does not know its context.

Maybe you can run your copy of Tomcat with debugger, using remote debugging?
http://wiki.apache.org/tomcat/FAQ/Developing#Debugging


Best regards,
Konstantin Kolinko
Matthew Tyson
2011-07-21 02:59:52 UTC
Permalink
Konstantin,

I may have to give the debugger a try - thanks for the info.

Matt

On Wed, Jul 20, 2011 at 1:02 PM, Konstantin Kolinko
Post by Konstantin Kolinko
Invalid byte tag in constant pool: 60
The above message is created by
o.a.tomcat.util.bcel.classfile.Constant#readConstant(...). There is a
switch() and default: label results in this exception being thrown.
Expected values there are from 1 to 12. Your 60 is far outside the
range.
Post by Konstantin Kolinko
3. Maybe if you enable debug logging in "org.apache.tomcat.util.bcel"
you will able to provide some context where the issue happens?
Did that - its actually how I got the name of the files failing.
I hoped to see some information about what class files in those jars
BCEL tries to scan when it fails.
Call hierarchy is
bcel.classfile.Constant#readConstant(...)
<- bcel.classfile.ConstantPool#ConstantPool(stream)
<- bcel.classfile.ClassParser#readConstantPool()
<- bcel.classfile.parse()
<- o.a.catalina.startup.ContextConfig#processAnnotationsStream(stream, webxml)
Unfortunately there is no debug printing in ContextConfig, and
ClassParser operates on a stream and so does not know its context.
Maybe you can run your copy of Tomcat with debugger, using remote debugging?
http://wiki.apache.org/tomcat/FAQ/Developing#Debugging
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
Loading...