Development Tip

사용자 정의 태그에 대한 Eclipse "태그 라이브러리 설명자를 찾을 수 없음"(JSTL이 아님!)

yourdevel 2020. 12. 1. 19:50
반응형

사용자 정의 태그에 대한 Eclipse "태그 라이브러리 설명자를 찾을 수 없음"(JSTL이 아님!)


Ant로 잘 빌드되고 JBoss에 완벽하게 배포되며 문제없이 실행되는 Java EE 프로젝트가 있습니다. 이 프로젝트에는 몇 가지 사용자 정의 태그 라이브러리 ( JSTL 이 아님 )가 포함되어 있으며, 이는 어려움없이 작동합니다.

문제는 Eclipse IDE (Ganymede)에 있습니다. 사용자 정의 태그를 사용하는 모든 단일 JSP 파일에서 JSP 파서는 다음 오류와 함께 taglib include 행에 플래그를 지정합니다.

Cannot find the tag library descriptor for (example).tld

이로 인해 탭 라이브러리의 모든 사용이 오류로 표시되고 IDE에 정의가 없으므로 태그 매개 변수 등을 확인할 수 없습니다.

완벽하게 작동하는 JSP 파일은 붉은 오류의 바다이며 내 눈이 타 오르기 시작했습니다.

Eclipse에 "찾고있는 태그 라이브러리 설명자가"src / web / WEB-INF / (example) -taglib / (example) .tld ")라고 간단히 말할 수 있습니까?

이미 Eclipse 지원 포럼에서이 질문을했지만 유용한 결과는 없습니다.


Eclipse Helios에서는 프로젝트 속성의 "Java EE 모듈 종속성"이 "배포 어셈블리"로 대체되었습니다.

따라서 Eclipse Helios 로이 문제를 해결하기 위해 내가 한 방법은 다음과 같습니다.

  • 패키지 탐색기에서 프로젝트를 마우스 오른쪽 버튼으로 클릭하고 "가져 오기 ..."를 선택합니다.
  • 기본 선택 "파일 ​​시스템"을 수락하고 "다음"을 누릅니다.
  • From 디렉토리 행에서 "찾아보기"를 누르고 tomcat 설치로 이동하여 webapps / examples / WEB-INF / lib 파일을 찾습니다 (나는 tomcat 6이 있고 다른 버전의 Tomcat에는 webapps / jsp-examples / WEB- 경로가있을 수 있습니다. INF / lib). 경로에서 확인을 누르십시오.
  • jstl.jar 및 standard.jar 옆을 클릭하여 확인란을 활성화합니다.
  • Into 폴더 라인에서 Browse를 클릭하고 라이브러리 폴더를 선택합니다. 프로젝트 내에서 / lib를 사용합니다.
  • "마침"을 클릭하십시오.
  • 패키지 탐색기보기에서 프로젝트를 마우스 오른쪽 버튼으로 클릭하고 속성을 선택합니다 (또는 Alt + Enter를 누름).
  • "Java 빌드 경로"를 클릭하십시오.
  • "Add Jar"를 클릭하고 프로젝트, lib 폴더를 클릭하고 jstl.jar을 선택한 다음 확인을 누릅니다.
  • "Add Jar"를 클릭하고 프로젝트, lib 폴더를 클릭하고 standard.jar을 선택한 다음 확인을 누릅니다.
  • 확인을 눌러 속성 대화 상자를 닫습니다.
  • 문제점보기를 클릭하고 "Classpath entry ... / jstl.jar은 내보내거나 공개되지 않습니다. 런타임 ClassNotFoundExceptions가 발생할 수 있습니다."메시지를 선택하십시오.
  • 그것을 마우스 오른쪽 버튼으로 클릭하고 "빠른 수정"을 선택하십시오.
  • 기본 "관련 원시 클래스 경로 항목을 게시 / 내보내기 종속성으로 표시"를 수락하고 마침을 누릅니다.
  • standard.jar에 대해서도 동일하게 수행하십시오.

이렇게하면 문제가 해결되지만 "배포 어셈블리"에서 무슨 일이 발생했는지 확인하려면 프로젝트 속성을 다시 열고 "배포 어셈블리"를 선택하면 standard.jar 및 jstl.jar이 WEB에 추가 된 것을 볼 수 있습니다. INF / lib 폴더.


이것이 내 문제 였고 어떻게 해결했는지 ...

나는 모두가 위에서 언급 한 모든 것을 수행했지만 여전히이 오류가 발생했습니다. 나는 밝혀이의 URI의 사용하던 http://java.sun.com/jsp/jstl/fmt하고 http://java.sun.com/jsp/jstl/core잘못되었습니다있다.

위의 URI를 다음으로 전환 해보십시오.

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

또한 클래스 경로에서 참조되는 올바른 jar가 있는지 확인하십시오.


줄무늬 taglib uri가 발견되지 않은 것으로 표시되는 것과 동일한 문제가 발생했습니다. 나는 Indigo와 Maven을 사용하고 있었고 Properties-> Java Build Path-> Order & Export Tab을 체크했을 때 (새 프로젝트 체크 아웃에서) 어떤 이유로 "Maven Dependencies"체크 박스가 체크되지 않은 것을 발견했습니다. 해당 확인란을 선택하고 Maven을 새로 설치하면 모든 오류가 해결되었습니다.

Eclipse가 빌드 경로에 Maven 종속성을 원한다고 가정하지 않는 이유가 궁금합니다.


원인은이 프로젝트가 Eclipse에서 실제로 Java EE 프로젝트로 간주되지 않았기 때문인 것으로 밝혀졌습니다. 3.1의 ​​오래된 프로젝트 였고, 우리가 지금 사용하고있는 Eclipse 3.5는 프로젝트 구성 파일에 몇 가지 "네이처"를 설정해야합니다.

<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>

JSP 파일을 올바르게 읽는 새로운 "동적 웹 프로젝트"를 만들고 이전 프로젝트의 구성과 비교하여 원인을 찾을 수있었습니다.

이 파일을 추가 할 수있는 유일한 방법은 .project 파일을 편집하는 것이었지만 프로젝트를 다시 연 후 모든 것이 마술처럼 작동했습니다. 위의 pribeiro에서 참조한 설정은 프로젝트가 이미 기본 설정을 따르기 때문에 필요하지 않았습니다.

pribeiro와 nitind의 답변은 모두 검색을 시작할 수있는 아이디어를 제공했습니다. 감사합니다.

UI 내에서 이러한 "자연"을 편집하는 방법이 있습니까?


같은 문제가 발생하여 maven을 사용하고 있으므로 웹 프로젝트의 pom에 추가했습니다.

<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>

이것은 문제를 해결했고 OP처럼 모든 것이 이미 JBoss에서 작동하고 있었기 때문에 "제공된"범위를 사용했습니다.

해결책을 찾은 곳은 다음과 같습니다. http://alfredjava.wordpress.com/2008/12/22/jstl-connot-resolved/


JSP에 JSTL Core Library를 포함하려고 할 때 :

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

Eclipse (Indigo)에서 다음 오류가 발생했습니다.

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

Project Properties-> Targeted Runtimes로 이동 한 다음 사용중인 서버 (Geronimo 3.0)를 확인했습니다. 대부분의 사람들은 Tomcat을 사용합니다. 이것은 내 문제를 해결했습니다. 도움이 되었기를 바랍니다.


오늘이 문제를 해결했습니다.

  • 출력 디렉토리를 WEB-INF / classes 폴더로 변경하십시오. (프로젝트 / 속성 / Java 빌드 경로, 기본 출력 폴더)
  • Assigne the module dependencies. (Project/Properties/Java EE Module Dependencies) they will be copied to the WEB-INF/lib folder where Eclipse looks for the tag lib definitions too.

I hope it helps.


A lot depends on what kind of project it is. WTP's JSP support either expects the JSP files to be under the same folder that's the parent of the WEB-INF folder (src/web, which it will then treat as "/" to find TLDs), or to have project metadata set up to help it know where that root is (done for you in a Dynamic Web Project through Deployment Assembly). How are you referring to the TLD file, and where is the JSP file located?

And maybe I missed the original post to the Eclipse forums; the one I saw was posted a full day after this one.


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

  1. jstl.jar
  2. standard.jar

I faced same problem. This is what I did to resolve the issue.

  1. Select Project and right click.
  2. Click on properties.
  3. Click on libraries tab.
  4. Click on 'Add Jars'.
  5. Add relevant jar for your error.

You can simply go to Build Path -> Add Libraries and for the library type to add select "Server Runtime." Click Next and select a server runtime to add to the classpath and the problem goes away if jstl.jar and standard.jar are in your server's classpath.


I'm using Spring STS plugin and a Spring webmvc template project. I had to install the Maven m2e plugin first: http://www.eclipse.org/m2e/

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


If your tld's are on the classpath, typically under the WEB-INF directory, the following two tips should resolve the issue (irrespective of your environment setup):

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

  2. If the tld does not have a <uri> element, the Container will attempt to use the uri attribute in the taglib directive as a path to the actual TLD. for e.g. I could have a custom tld file in my WEB-INF folder and use the path to the this tld as the uri value in my JSP. However, this is a bad practice and should be avoided since the paths would then be hardcoded.


I had the same problem with MyEclipse and Eclipse 6.6.0. It red lined the uri value in every

<%@ 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 under 'Project/MyEclipse/Web/Configure workspace settings.../Tag Libraries'.


I had the same problem with STS (springtool source suite).

Under STS, right click on the project, than "Properties", "Project Facets", than on the right of the window click on the "runtime" tab, and check "VMware vFabric tc Server (...)", and click "Apply" and it should be OK after the workspace refresh.


well you need to understand there are always two things the API and the implementation (mind 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'

so If you're using a servlet container with no jstl support then of course it will not provide both of them, a mistake which I made is that I only put the first one, but if you're using full stack application server i.e glassfish then glassfish will have both of them already inside.


For me, this error occurs whenever I try to use a new version of eclipse. Apparently, the 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 M2_REPO variable to point to actual maven repository location, it takes 2-3 Project -> Clean iterations to get everything working.

And sometimes, there are some xml validation errors(ejb) along with this tag library errors. Manually updating the corresponding XML file, initiates a *.xsd file lookup and the xml validations errors are resolved. Post this, the tag library errors also vanish.


On the other hand, if you are only working on java source and are getting these errors from stuff you don't touch in a large project that is working, you can just turn off the validations in Eclipse. The settings are under Preferences->Web->JSP Files->Validation


I was having the same problem using Tomcat 6.0 and Eclipse and I tried out something which my friend suggested and it worked for me. The link for the question I asked and my reply commented can be found here:

JSTL Tomcat 6.0 Cannot find the taglib descriptor Error

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


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 set in the TLD document. Eclipse releases typically lag behind up to a year in implementing newer servlet and JSP specifications. See this Eclipse bug for example.

In this case, your web application may run fine in the latest version of Tomcat, but Eclipse may still complain about a missing TLD. The short term solution (short of ignoring the error in Eclipse) is to bump down the JSP version to the one that your version of Eclipse supports.

Also, keep in mind the TLD version you are implementing. The tag names have changed slightly from v1.1 to v2.0 (i.e., info is now description on taglib and is not a valid element under tag, many of the element names now contain a hyphen). Eclipse has no tolerance for misspelled TLD tag names.

TLD 2.0 (jsp-version 2.0) Reference

TLD 2.1 (jsp-version 2.3) Reference


replace jstl.jar to jstl1.2.jar resolved the issue for tomcat 7.0


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

참고URL : https://stackoverflow.com/questions/1265309/eclipse-cannot-find-the-tag-library-descriptor-for-custom-tags-not-jstl

반응형