December 18th, 2013

Just a quick post about this error I was receiving today as the error is very unhelpful and it took me a while to figure out what was wrong.

I was trying to define a taglib in my web.xml as follows


On starting tomcat I got this very unhelpful stack

20131218 14:26:54.794 [localhost-startStop-1] WARN org.apache.catalina.startup.TldConfig – Failed to process TLD with path [http://] and URI [/WEB-INF/mytaglib.tld] null
at ~[na:1.6.0_43]
at ~[na:1.6.0_43]
at ~[na:1.6.0_43]
at ~[na:1.6.0_43]
at ~[na:1.6.0_43]
at ~[na:1.6.0_43]
at ~[na:1.6.0_43]
at ~[na:1.6.0_43]
at ~[na:1.6.0_43]
at$JAXPSAXParser.parse( ~[na:1.6.0_43]
at org.apache.tomcat.util.digester.Digester.parse( ~[tomcat-coyote.jar:7.0.47]
at org.apache.catalina.startup.TldConfig.tldScanStream( [catalina.jar:7.0.47]
at org.apache.catalina.startup.TldConfig.tldScanWebXml( [catalina.jar:7.0.47]
at org.apache.catalina.startup.TldConfig.execute( [catalina.jar:7.0.47]
at org.apache.catalina.startup.TldConfig.lifecycleEvent( [catalina.jar:7.0.47]
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent( [catalina.jar:7.0.47]
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent( [catalina.jar:7.0.47]
at org.apache.catalina.core.StandardContext.startInternal( [catalina.jar:7.0.47]
at org.apache.catalina.util.LifecycleBase.start( [catalina.jar:7.0.47]
at org.apache.catalina.core.ContainerBase.addChildInternal( [catalina.jar:7.0.47]
at org.apache.catalina.core.ContainerBase.addChild( [catalina.jar:7.0.47]
at org.apache.catalina.core.StandardHost.addChild( [catalina.jar:7.0.47]
at org.apache.catalina.startup.HostConfig.deployWAR( [catalina.jar:7.0.47]
at org.apache.catalina.startup.HostConfig$ [catalina.jar:7.0.47]
at java.util.concurrent.Executors$ [na:1.6.0_43]
at java.util.concurrent.FutureTask$Sync.innerRun( [na:1.6.0_43]
at [na:1.6.0_43]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask( [na:1.6.0_43]
at java.util.concurrent.ThreadPoolExecutor$ [na:1.6.0_43]
at [na:1.6.0_43]

You’ll probably notice the path and URI labelled wrong in the log – this is a red herring. What’s actually the problem is that Tomcat can’t find your tld file. So double check you have the name and location of the tld file correct in your web.xml (case sensitive on *nix) and that the tld file is correctly included in your war. My problem was the my maven project pom.xml didn’t include tld files when it packaged up the war.

I raised a Tomcat bug to make the error message clearer