You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Phil Hanna <ph...@ipass.net> on 2000/07/16 09:39:05 UTC

Bug in org.apache.jasper.compiler.TagLibraryInfoImpl ?

I have written a JSP tag library and packaged it as a .jar file.  The META-INF/taglib.tld entry contain the tag library descriptor.

When I specify the location of the TLD explicitly in the taglib directive, Tomcat finds it and the JSP page works fine:

   <%@ taglib prefix="x" uri="/WEB-INF/lib/mylib.jar" %>

However, when I put a mapping in the web.xml file and make the reference indirect, it fails:

   <%@ taglib prefix="x" uri="/mylib" %>

where the following entry is in web.xml:

   <taglib>
      <taglib-uri>/mylib</taglib-uri>
      <taglib-location>/WEB-INF/lib/mylib.jar</taglib-location>
   </taglib>

In this case, the compiler complains:
org.apache.jasper.compiler.CompileException: D:\jspcr\Chap10\Test1.jsp(1,0) Unable to open taglibrary /mylib : Parse Error in the tag library descriptor: Character conversion error: "Malformed UTF-8 char -- is an XML encoding declaration missing?" (line number may be too low).

Possibly it is trying to read the JAR file itself as if it were the TLD?  I know that the jar file is not corrupt, because it works fine when the URI is specified explicitly.  It only fails when it is mapped through web.xml.

FWIW - I tested both approaches with the same files in JRun 3.0, and both worked.