Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 330229

Summary: Jetty tries to parse META-INF/*.tld when jsp-api is not on classpath, causing DTD entity resoluton to fail
Product: [RT] Jetty Reporter: Eirik Bjørsnøs <eirbjo>
Component: serverAssignee: Jan Bartel <janb>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: gregw, janb, jetty-inbox
Version: unspecified   
Target Milestone: 7.1.x   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Eirik Bjørsnøs CLA 2010-11-15 06:59:03 EST
Build Identifier: 


In newParser(), TagLibConfiguration.java redirects JSP DTDs from http://java.sun.com to resources from the JSP classpath.

This redirection only occurs if the class javax.servlet.jsp.JspPage is found to be on the classpath.

However, when JspPage is NOT on the classpath, TagLibConfiguration.preConfigure will happily try to parse TLDs which will work as long as your production machine has access to java.sun.com AND java.sun.com is available (it wasn't this morning :-)

I don't see why TldConfiguration should care to parse TLDs when JSP is not on the classpath.

Could a fix be just to wrap the parsing logic with a check to see if JspPage exists?

This was tested on Jetty 7.2.0.v20101020
 

Reproducible: Always

Steps to Reproduce:
1. Create a non-JSP Jetty webapp
2. Add a jar containing a TLD to WEB-INF/lib (try oscache-2.3.jar)
3. Take your app off the network
4. Observe a connection timeout/error in TldProcessor.parse
Comment 1 Jan Bartel CLA 2010-11-16 20:42:11 EST
*** Bug 330409 has been marked as a duplicate of this bug. ***
Comment 2 Jan Bartel CLA 2010-11-16 20:47:13 EST
Eirik,

You're brilliant! Another user had reported problems with resolving jsp tab lib
dtds, but it didn't occur to me to consider that the jsp jars had been removed!
Of course, in earlier versions of jetty-7, we weren't distributing jsp with the
tar at eclipse, so in fact the jsp jars would not have been present. Mystery
solved!

I've guarded tag lib processing with a check to see if the jsp page can be
loaded. Fix is rev 2525.

thanks
Jan