When using a custom taglib in a JSP, what is cause of the exception ( org.apache.jasper.JasperException: Unable to open taglibrary http://www.yourcompany.com/taglibs : Unable to open the tag library descriptor: Stream closed)?

Serge Knystautas

More than likely, you have not properly mapped the taglib URI to a local TLD file. In web.xml (in your webapp's WEB-INF directory or in the server's conf directory), you need to map that taglib URI to a TLD file. I generally put my TLD files in my WEB-INF directory, and then in my web.xml I add the following line:

If this is properly mapped, when you declare the taglib in your JSP, it will find the TLD and parse appropriately.

Generally that error means it could not find the mapping in your web.xml and your JSP engine attempted to open a URL connection to that taglib URI. As your taglib URI is not necessarily supposed to be a valid URL, this almost always fails. The "Stream closed" message is a result of the taglib URI server (in our case, www.yourcompany.com) returning a 404 or some other failure message in response to the request for the TLD.

If your local TLD file has XML problems, you will see a similar message, but instead of Stream closed, you will see another non-descript "error parsing" message.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact