Wednesday, June 1, 2011

Unable to read TLD “META-INF/c.tld” from JAR file

I was trying to run spring mvc with maven and got this error - “Unable to read TLD “META-INF/c.tld” from JAR file…”.

After a research I have found the fix.

So JasperServer contains in WEB-INF/lib some servlet libraries?!?! Could be possible it’s not a war made by me so somebody could have made some mistake. Listing the files in WEB-INF/lib i found the entire world of web libraries, included jsp-api. Yes this is the problem!

Tomcat excludes genonimo.jar because it contains Servlet api’s but loads jsp-api located in WEB-INF/lib because no checkis made. No jsp can be compiled because jasper (not jasper reports) compiles from a classloader and jsp-api are located in a different classloader.

Removig jsp-api everything works fine again.