1

I am facing a problem on my migration to Tomcat7 to Tomcat9.

I am trying to deploy my web app but I keep having the same error:

org.apache.jasper.JasperException: /tiles/layout.jsp (Zeile: [5], Spalte: [0]) Unable to find taglib [myTagLib] for URI: [/META-INF/myTagLib.tld]

For sure I did not change the structure of my app so I cannot understand where is the problem. I tried to change the path of the Taglib but it does not work.

This is the definition I have: File layout.jsp:

<%@ include file="/WEB-INF/include/taglibs.jsp" %>

File taglibs.jsp:

<%@ taglib prefix="gam" uri="/META-INF/gam-html.tld"%>

Here two screenshots showing the file system on Eclipse and Explorer (please note the name of the files have been crossed due to privacy issues):

Eclipse

Explorer

I have researched and it seems that tomcat 9 performs a different taglib scanning as previous versions: https://talk.openmrs.org/t/unable-to-find-taglib-c-for-uri-web-inf-view-module-legacyui-taglibs-c-rt-tld/10832/5

Anyone has any idea of what to do here? Thanks a lot in advance.

Update I just realised, if I move the file to any folder under web-inf and modify the URI it works. I moved it to the same folder as taglibs.jsp on WEB-INF/include/myTaglib.tld Apparently the scanning only works on folders under web-inf? anybody knows how to change this?

Carloshf
  • 529
  • 1
  • 6
  • 25

2 Answers2

0

so after a few tests, I found a solution.

Apparently with the new version of Struts, the way of loading files and searching for libraries works different and basically what I did was to change the path of the file to:

<%@ taglib prefix="gam" uri="/WEB-INF/include/gam-html.tld"%>

So just move the file here and it should work. If anybody finds another solution I would be glad to read it as this is actually a workaround.

Carloshf
  • 529
  • 1
  • 6
  • 25
0

I also ran into this issue, so far, I tried replacing the URI value in the JSP with the value defined in the tld file, and it works.