Error "File /META-INF/tags/HelloTag.tag not found" when creating custom JSP Tag lib | Community
Skip to main content
Level 2
Dec 5, 2015 8:56 PM UTC

Error "File /META-INF/tags/HelloTag.tag not found" when creating custom JSP Tag lib

Hi All,

I am creating a JSP custom tag using tag file but i am getting following error

org.apache.sling.api.scripting.ScriptEvaluationException: org.apache.sling.scripting.jsp.jasper.JasperException: File "/META-INF/tags/HelloTag.tag" not found

 

tag file is located at /META-INF/tags/HelloTag.tag

Following are content of tag definition file located at //META-INF/taglibs.tld

<taglib xmlns="http://java.sun.com/xml/ns/javaee"        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee        http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_1.xsd" version="2.1">    <tlib-version>1.0</tlib-version>    <short-name>Angular</short-name>    <uri>http://abc.org/Hello/Taglib</uri>    <tag-file>        <name>Hello</name>        <path>/META-INF/tags/HelloTag.tag</path>    </tag-file></taglib>

Also following is the configuration of bundle plugin

 

<plugin>    <groupId>org.apache.felix</groupId>    <artifactId>maven-bundle-plugin</artifactId>    <extensions>true</extensions>    <configuration>        <instructions>            <Bundle-SymbolicName>org.abc.angularjs-tags-aem</Bundle-SymbolicName>            <Sling-Model-Packages>org.abc.web.jsp.angularjs.tags</Sling-Model-Packages>            <Bundle-Resource>/META-INF/tags</Bundle-Resource>            <Sling-Bundle-Resource>/META-INF/tags</Sling-Bundle-Resource>        </instructions>    </configuration></plugin>

I read following blogs for creating this sample.

http://labs.6dglobal.com/blog/2013-07-02/tagfile-vs-tag-sling-or-cq5-application/

http://www.cqblueprints.com/tipsandtricks/jsp-custom-tag-lib.html

https://helpx.adobe.com/experience-manager/using/customtags.html

Also full maven artifact is attached with this form.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

17 replies

Level 3
Oct 26, 2017 6:42 PM UTC

I'm having the exact same issue as the other folks on this issue. arunjoshh​ are you able to confirm that Adobe has a patch available?

Translate
Oct 26, 2017 6:49 PM UTC

The issue was fixed in https://issues.apache.org/jira/browse/SLING-7044

This fix will be included in AEM 6.3.1.1, you can contact Adobe to get the pacth for this issue.

Thanks

Arun

Translate
chanchalesj6077
Level 2
Aug 22, 2017 3:33 PM UTC

Same problem I am facing with AEM 6.3 , any clue?

I have used tld generator maven plugin in my project. it successfully generating the tld file in jar file but not able to access the .tag file.

Translate
Aug 22, 2017 3:43 PM UTC

The issue was fixed in https://issues.apache.org/jira/browse/SLING-7044

Summary of the issue :

If a taglib in a bundle references a tag implemented as a script (located in /META-INF/tags) this script is not found as it is not searched within the bundle containing the tld - it's rather used as a resource on the classpath.

Please contact Adobe to get the patch fix for this issue.

Thanks

Arun

Translate
nvssr90
Level 2
Jul 7, 2017 7:07 PM UTC

I am getting same issue when migrating from AEM 6.1 to AEM 6.3. We did an inplace upgrade. How do I find obsolete bundles in my instance. I dont have above bundles mentioned by Stanleyor.

Any thoughts what I need to check?

Thanks in advance!

Translate
edubey
Level 10
Dec 5, 2015 9:06 PM UTC

Can you share your JSP code?

Translate
Level 2
Dec 6, 2015 8:18 PM UTC

I am using AEM 6.1 version.

https://helpx.adobe.com/experience-manager/using/customtags.html talks about custom tag using Java class but in my case I am using tag file (*.tag file).

Following is the jsp file

<%@page session="false" %><%@include file="/libs/foundation/global.jsp" %><%@ taglib prefix="cq" uri="http://www.day.com/taglibs/cq/1.0" %><%@ taglib prefix="hello" uri="http://abc.org/Hello/Taglib" %><body data-ng-app="angularjsSample"  data-ng-controller="BaseController">    <hello:Hello target="World"/></body>

Also following is the tag file.

<%@ attribute name="target" required="true" rtexprvalue="false" type="java.lang.String" %><div> Hello <%=target%> </div>
Translate
edubey
Level 10
Dec 6, 2015 8:40 PM UTC

Okay, so it seems you are creating .tag files not .tld.

You need to use /WEB-INF/tags as shown below

JSP, sample.jsp

<%@ page contentType="text/html" %> <%@ taglib prefix="my" tagdir="/WEB-INF/tags/myCustomTags" %> <html> <body> NAME : <my:name /> </body> </html>

TAG, name.tag

<%@ tag body-content="empty" %> <% out.println("AEM Developer"); %>

Please see these:

https://nikojava.wordpress.com/2009/01/12/jsp-custom-tags-part1-create-tag-file/

http://archive.oreilly.com/pub/a/onjava/excerpt/jserverpages3_ch11/index.html

Translate