A problem with thread synchronization in org.apache.taglibs.scrape.PageData leads to a java.lang.IllegalThreadStateException. Looking at PageData CVS rev 1.15. In scrapePage(), a synchronized(scraping) attempts to protect the instantiation and start()-ing of the new Page object (Thread). This fails however, as scraping is an instance variable, and whilst still inside the critical section, scraping is reassigned: scraping = new Boolean(true); ... unprotecting the critical section. The result is that it is possible for two threads to attempt to start() the same page object, resulting in: java.lang.IllegalThreadStateException at java.lang.Thread.start(Native Method) at org.apache.taglibs.scrape.PageData.scrapePage(PageData.java:549) at org.apache.taglibs.scrape.PageTag.doEndTag(PageTag.java:152) at org.apache.jsp.scrap_jsp._jspService(scrap_jsp.java:165) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) Recommended solution: don't use "scraping" as the mutex if it needs to be reassigned during the critical section. A second lock Object might be more appropriate. As per any thread-related bug, this is difficult to reproduce, as you need two threads to hit the expiring page at once, however in this case a review of the code should make it clear how this problem can occur, and the fix is fairly simple. Let me know if you need a patch submitted.
Resolving. Taglib has been retired.