Bug 60169 - ClassFormatException in processAnnotationsFile during Startup
Summary: ClassFormatException in processAnnotationsFile during Startup
Status: RESOLVED WONTFIX
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.0.36
Hardware: PC other
: P2 minor (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-23 19:53 UTC by Joe Scarabino
Modified: 2016-09-24 10:21 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Scarabino 2016-09-23 19:53:12 UTC
Attempting to run Tomcat 8.5.036 on z/OS with 64 bit IBM Java 8 causes a ClassFormatException in processAnnotationsFile during Startup.


Steps to Reproduce:
Start Tomcat


Actual Results:
Tomcat fails to start.  STDERR shows the following error for multiple files:

org.apache.catalina.startup.ContextConfig processAnnotationsFile
SEVERE: Unable to process file ./cai/esd/CCS14/6B/nsmem/browser/help/abrowser/idmsagent/element.class. for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: It is not a Java .class file
.at org.apache.tomcat.util.bcel.classfile.ClassParser.readID(ClassParser.java:202)
.at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:80)
.at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2042)
.at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2025)
.at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2019)
.at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2019)
.at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2019)
.at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2019)
.at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2019)
.at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2019)
.at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2019)
.at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2019)
.at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2019)
org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2019)
.at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1961)
.at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1912)
.at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1157)
.at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:779)
.at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:306)
.at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
.at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
.at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5202)
.at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)        
.at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
.at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)     
.at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)       
.at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1092)
.at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1834)
.at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)     
.at java.util.concurrent.FutureTask.run(FutureTask.java:267)                    
.at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1143)
.at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:618)
.at java.lang.Thread.run(Thread.java:785)                                       

SYSOUT shows:
JVMJZBL1023N Invoking org.apache.catalina.startup.Bootstrap.main()...
JVMJZBL1056I Arguments to main...                                    
JVMJZBL1057I start                                                   
CEE5230S The signal SIGXCPU was received.                            


Workaround:
In context.xml, add the following line:
<JarScanner scanClassPath="false"/>

This seems to prevent the scanning for annotations files since not all of our .class files are Java .class files.
Comment 1 Mark Thomas 2016-09-24 10:21:02 UTC
I don't think that Tomcat should be expected to handle the situation where there are .class files on the Java class path that are not Java classes.