Bug 59567

Summary: NPE in org.apache.jasper.servlet.TldScanner$TldScannerCallback.scanWebInfClasses
Product: Tomcat 8 Reporter: Andrei Ivanov <andrei.ivanov>
Component: JasperAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 8.0.35   
Target Milestone: ----   
Hardware: PC   
OS: All   

Description Andrei Ivanov 2016-05-18 16:11:18 UTC
Upgrading from 8.0.32 to 8.0.35 triggers the following NPE:

18-May-2016 10:14:21.118 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: 
 org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/inventorymanager]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153)
	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.deployWAR(HostConfig.java:940)
	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1816)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
	at org.apache.jasper.servlet.TldScanner$TldScannerCallback.scanWebInfClasses(TldScanner.java:401)
	at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:208)
	at org.apache.jasper.servlet.TldScanner.scanJars(TldScanner.java:262)
	at org.apache.jasper.servlet.TldScanner.scan(TldScanner.java:106)
	at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:103)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5261)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
	... 10 more


Seems it's because there's an empty folder WEB-INF/classes/META-INF.

The workaround is to create an empty file in that folder.
Comment 1 Remy Maucherat 2016-05-18 16:21:32 UTC
Ok, the code in scanWebInfClasses was changed to use getResourcePaths, which returns null for non existing paths, which then causes a NPE. I will fix that.
Comment 2 Remy Maucherat 2016-05-18 16:36:53 UTC
The fix will be in 9M7, 8.5.3 and 8.0.36.
Comment 3 Andrei Ivanov 2016-05-18 16:49:43 UTC
Great :-)
Thank you.