AEM 6.5 custom tag library | Community
Skip to main content
Level 4
July 25, 2023
Question

AEM 6.5 custom tag library

  • July 25, 2023
  • 2 replies
  • 1312 views

I am working on an upgrade from AEM 6.2 to AEM 6.5. I am also moving from a very old archetype to the newer archetype 40 with profiles so that the build and deploy may be automated instead of a lot of manual steps that are now being used.

I am having problems with the JSP files that include some custom tag libraries. Using the older pom files, the tag libraries seem to be being resolved, I'm guessing is that the TLD files are being deployed but I can't find them in the instance so I know where to install them. The taglib uri is not being resolved but is not a problem in the older archetype's install.

What do I need to do to get the custom TLD files to be installed or referenced by the JSP using them?

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

2 replies

Nishant-Singh
Adobe Employee
Adobe Employee
July 25, 2023

Here are some steps you can take to resolve the issue:

  1. Check TLD Deployment: First, ensure that the custom TLD files are included in your project's deployment package. Verify that the TLD files are being copied to the appropriate location within the deployed AEM application.

  2. TLD Deployment Location: By default, custom TLD files should be placed in the /META-INF directory of your bundle. Make sure that your project structure is set up correctly to include the TLD files in the appropriate location.

  3. Check the Bundle Contents: After deploying your application to AEM 6.5, you can check the contents of the deployed bundle to see if the TLD files are present. You can do this by exploring the installed bundles in AEM's Web Console (http://localhost:4502/system/console/bundles) or by directly examining the contents of the deployed bundle in the crx-quickstart/launchpad/felix/bundle directory of your AEM instance.

  4. Check OSGi Configuration: If the TLD files are present in the bundle but not being resolved, it's possible that the OSGi bundle containing the TLD files is not active or not configured correctly. Check the OSGi configuration and ensure that the bundle containing the custom TLD files is active and has its dependencies resolved.

  5. Bundle Order: Check the order in which the bundles are started. If the bundle containing the TLD files depends on other bundles, ensure that those dependencies are resolved before the bundle with the TLD files starts.

  6. Bundle Export-Package: Verify that the packages containing the TLD files are properly exported by the OSGi bundle that contains them. If necessary, add the appropriate package exports to the bundle's manifest file.

Level 4
August 17, 2023

The taglibs are in the bundle under /META-INF/[tld file name]. I see the file there in the manifest in the /system/console/bundle page and when I run jar tvf [bundle name] then I see the files there and the correct byte size in the bundle. The JSP is still unable to discover the configuration. 

One caveat is that the JSP for the page is in a different bundle from the taglib classes and definition files. Should that matter?

Level 4
August 18, 2023

I have the TLD files both under /META-INF/ and /META-INF/tags in the package that contains the supporting Java classes. The bundle is active, I can get a listing of the files in the bundle and I see the TLD files in the bundle under the /META-INF and /META-INF/tags folders. Still the URI is not resolving when the JSP is being compiled.

kautuk_sahni
Community Manager
Community Manager
October 18, 2024

@robertharperfs If you have successfully found a solution on your own, we kindly ask that you share it with the community for future reference and mark it as the correct answer.

Kautuk Sahni