Eclipse "cannot find tag library descriptor" for custom tags (not JSTL!)

I have a Java EE project that works great with Ant, works great for JBoss, and works without problems. This project includes several custom tag libraries (which are not JSTL !), Which also work without any difficulty.

Problem with the Eclipse IDE (Ganymede): in every single JSP file that uses our custom tags, the JSP parser with the taglib flag includes a line with the error "Cannot find the tag library descriptor for (example) .tld"

It also means that any use of the tab library should be flagged as an error, and since the IDE does not have its own definition, it cannot check tag parameters, etc.
Our excellent JSP files are a sea of ​​red bugs and my eyes start to burn.

How can I just tell Eclipse "The tag library identifier you are looking for is src / web / WEB-INF / (example) -taglib / (example) .tld"?

I already asked this question in the Eclipse support forums without any useful results.

+60
eclipse jsp custom-tags taglib
Aug 12 '09 at 10:05
source share
22 answers

It turns out the reason is that this project was not considered by Eclipse to be actually a Java EE project at all; it was an old project from 3.1, and now Eclipse 3.5, which we use, requires that several natures be specified in the project configuration file.

<natures> <nature>org.eclipse.jdt.core.javanature</nature> <nature>InCode.inCodeNature</nature> <nature>org.eclipse.dltk.javascript.core.nature</nature> <nature>net.sf.eclipsecs.core.CheckstyleNature</nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature> <nature>org.eclipse.wst.common.project.facet.core.nature</nature> <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> </natures> 

I managed to find the reason by creating a new "Dynamic Web Project" that read its JSP files correctly and was different from the configuration of the old project.

The only way I could add is to edit the .project file, but after re-opening the project everything worked magically. The settings referenced by pribeiro above are not needed because the project already matches the default settings.

Both pribeiro and nitind answers gave me ideas to speed up the search, thanks.

Is there any way to edit these "natures" from the user interface?

+10
Oct 19 '09 at 8:28
source share

In Eclipse Helios, "Java EE Module Dependencies," the Deployment Assembly was replaced in the project properties.

So, to solve this problem with Eclipse Helios, as I did, this is the following:

  • Right-click on the project in the package explorer and select "Import ..."
  • Accept the default file system selection and click Next.
  • Click "Browse" in the "From" line, go to your tomcat installation and find the webapps / examples / WEB-INF / lib file (I have tomcat 6, other versions of Tomcat may have the path webapps / jsp-examples / WEB-INF / Library). Once on the way click OK.
  • Click except jstl.jar and standard.jar to activate checkboxes
  • In the To folder row, click Browse and select the library folder. I am using / lib inside a project.
  • Click Finish
  • Right-click on the project in the Package Explorer view and select properties (or press Alt + Enter)
  • Click "Java Build Path"
  • Click "Add Jar", click on your project, lib folder, select jstl.jar, click OK
  • Click "Add Jar", click on your project, lib folder, select standard.jar, click OK
  • Click OK to close the properties dialog.
  • Click View Issues and select the message β€œClasspath entry ... / jstl.jar will not be exported or published. Runtime ClassNotFoundExceptions may occur.”
  • Right-click on it and select "Quick Fix."
  • Accept the default value "Mark the associated source path class entry as a publication / export dependency" and click "Finish".
  • Do the same for standard.jar

This solves the problem, but if you want to check what happened in the "Deployment Unit", open the project properties again, select "Deployment assembly", and you will see that the standard .jar and jstl.jar have been added to the WEB-INF / lib folder .

+28
Jan 20 2018-11-11T00:
source share

That was my problem and how I fixed it ...

I did everything I mentioned above, etc., but still got this error. Turns out I used the uri http://java.sun.com/jsp/jstl/fmt and http://java.sun.com/jsp/jstl/core , which were wrong.

Try translating uris from above to:

 http://java.sun.com/jstl/fmt http://java.sun.com/jstl/core 

Also, make sure you have the correct bans specified in your class path.

+18
Nov 01 '10 at 21:33
source share

I had the same problem with taglib uri strips until they were found. I used Indigo and Maven, and when I checked Properties-> Java Build Path-> Order and Export Tab, I found (with a new project check) that the "Maven Dependencies" box was unchecked for some reason. By simply checking this field and performing a clean install of Maven, all errors have been removed.

I wonder why Eclipse does not assume that I need my Maven dependencies in the build path ...

+12
Nov 23 '11 at 10:57
source share

In the same problem, I use maven, so I added this to pom in my web project:

 <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> <!-- just used the latest version, make sure you use the one you need --> <scope>provided</scope> </dependency> 

This fixed the problem and I used the "provided" area because, like the OP, everything already worked in JBoss.

Here where I found the solution: http://alfredjava.wordpress.com/2008/12/22/jstl-connot-resolved/

+8
Nov 21 '11 at 18:46
source share

When I tried to include the main JSTL library in my JSP:

 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 

The following error appeared in Eclipse (Indigo):

 Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core" 

I went to Project Properties -> Targeted Runtimes, and then checked the server I used (Geronimo 3.0). Most people will use Tomcat. This solved my problem. Hope this helps!

+4
Mar 21 '13 at 14:45
source share

A lot depends on what kind of project it is. WTP support JSP expects JSP files to be in the same folder as the WEB-INF parent folder (src / web, which it will process as "/" to find TLD), or that the project metadata be configured to help it find out where this root is (done for you in a dynamic web project through the deployment assembly). How do you feel about the TLD file and where is the JSP file located?

And maybe I missed the original post on the Eclipse forums; the one I saw was published the day after that.

+3
Aug 18 '09 at 16:43
source share

I fixed this issue today.

  • Change your output directory to the WEB-INF / classes folder. (Project / Properties / Java Build Path, default exit folder)
  • Assign module dependencies. (Project / Properties / Java EE Module Dependencies), they will be copied to the WEB-INF / lib folder, where Eclipse also looks for lib tag definitions.

Hope this helps.

+3
Sep 25 '09 at 15:08
source share

Check out the two libraries in F:\apache-tomcat-7.0.21\webapps\examples\WEB-INF\lib :

  • jstl.jar
  • standard.jar
+2
Sep 03 2018-11-11T00:
source share

I had the same problem. This is what I did to solve the problem.

  • Select a project and right-click.
  • Click on properties.
  • Go to the libraries tab.
  • Click Add Cans.
  • Add the appropriate jar for your mistake.
+2
Jun 14 '13 at 9:49 on
source share

You can simply go to "Build Path" β†’ "Add Libraries", and for the type of library add "Server Runtime". Click Next and select the server runtime to add the class path and the problem will disappear if jstl.jar and standard.jar are in your path to the server class.

+1
Nov 11 '11 at 5:24 a.m.
source share

I am using Spring STS plugin and Spring webmvc template project. First I needed to install the Maven m2e plugin: http://www.eclipse.org/m2e/

And then clean the project. Under Project -> Clean...

+1
Feb 10 '13 at
source share

If your tld is in the classpath, usually in the WEB-INF directory, the following two tips should solve the problem (regardless of your environment setting):

  • Make sure that the <uri> in the TLD and uri in the taglib directive of your jsp pages match. The <uri> tld element is a unique name for the tag library.

  • If tld does not have a <uri> element, the container will try to use the uri attribute in the taglib directive as the path to the actual TLD. eg. I could have my own tld file in my WEB-INF folder and use the path to this tld as the uri value in my JSP. However, this is bad practice and should be avoided since the paths will then be hardcoded.

+1
Sep 17 '13 at 7:21
source share

I had the same issue with MyEclipse and Eclipse 6.6.0. This is the red alignment of the uri value in each

<%@ taglib prefix="s" uri="/struts-tags"%> . I fixed it by going to "Project / MyEclipse / Web / Tag Libraries" and setting the default TLD prefix for Struts 1.2 Tiles Tags to 's'. I also had to do the same in the section "Project / MyEclipse / Web / Setting Workspace Settings ... / Tag Libraries".

0
May 7 '10 at 17:31
source share

I had the same problem with STS (Springtool source package).

In STS, right-click on the project than "Properties", "Project Boundaries", and to the right of the window click the "Runtime" tab and check "VMware vFabric tc Server (...)", and click "Apply" , and after updating the workspace, it will be fine.

0
Feb 29 '12 at 19:00
source share

I had the same issue with Tomcat 6.0 and Eclipse, and I tried what my friend suggested, and it worked for me. The link to the question I asked, and my answer is commented, can be found here:

JSTL Tomcat 6.0 Cannot find taglib Error descriptor

Let me know if this solves the "Cannot find taglibrary descriptor" problem.

0
Apr 04 2018-12-12T00:
source share

well you need to understand that there are always two things: API and implementation (remember the gradle format of the following code)

compile group:'javax.servlet.jsp.jstl', name:'javax.servlet.jsp.jstl-api', version:'1.2.1'

compile group:'org.glassfish.web', name:'javax.servlet.jsp.jstl',version:'1.2.1'

Therefore, if you use a servlet container without jstl support, then of course it will not provide both of them, the error I made is that I only put the first one, but if you use the full-stack server application, that is glass fish, then in glass fish they will already be inside.

0
Jan 29 '14 at 5:39 on
source share

For me, this error occurs when I try to use the new version of eclipse. Apparently, a new eclipse resets the M2_REPO variable, and I get all the tag library error in the Marker view (sometimes with ejb validation errors).

After updating the M2_REPO variable, in order to indicate the actual location of the maven repository, 2-3 Project β†’ Clean iterations are required for everything to work.

And sometimes there are some xml validation errors (ejb) along with tag library errors. Manually updating the corresponding XML file initiates a search for the * .xsd file and resolves xml validation errors. In this case, the tag library errors also disappear.

0
Aug 12 '14 at 6:24
source share

On the other hand, if you only work with the java source and get these errors due to the fact that you are not touching a large working project, you can simply turn off the checks in Eclipse. Settings are in the "Settings" β†’ "Web Files" - "JSP Files" β†’ "Verification"

0
Oct 13 '14 at 21:06
source share

This error can arise from several different sources. One case (not mentioned in other answers to this question) occurs when Eclipse does not implement the version of the JSP specification specified in the TLD document. Eclipse applications typically lag behind the year before introducing new servlets and JSP specifications. See this Eclipse error for example.

In this case, your web application may work fine in the latest version of Tomcat, but Eclipse may still complain about the lack of TLD. The short-term solution (apart from the error in Eclipse) is to downgrade the JSP to the version supported by your version of Eclipse.

Also, keep in mind the version of TLD that you are implementing. Tag names have changed slightly from v1.1 to v2.0 (i.e. info now description on taglib and is not a valid element in tag , many element names now contain hyphens), Eclipse does not have tolerances for tag names with spelling errors.

TLD 2.0 (jsp version 2.0) Link

TLD 2.1 (jsp version 2.3) Link

0
Nov 16 '16 at 21:17
source share

replace jstl.jar with jstl1.2.jar, solved the problem for tomcat 7.0

-one
Oct 18 '15 at 14:06
source share

I also ran into the same problem. Make sure you have the same JSTL versions in Eclipse and in the Tomcat working directory, i.e. In the folder \webapps\examples\WEB-INF\lib and lib .

-four
Mar 27 '14 at 12:13
source share



All Articles