简体   繁体   English

在Maven Eclipse项目中找不到Spring框架的标签库描述符

[英]cannot find tag library descriptor for spring framework in maven eclipse project

The following three lines at the top of documents.jsp throw "cannot find tag library descriptor for ..." errors in the spring framework application from this tutorial , which uses eclipse and maven: 本教程 (使用eclipse和maven)的spring框架应用程序中,documents.jsp顶部的以下三行引发“找不到...的标记库描述符”错误:

<%@ taglib uri="http://www.springframework.org/tags"  prefix="spring"%>  
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>  
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>  

My understanding is that the maven plugin for eclipse should manage the download of these libraries automatically, so I checked to make sure that the following are included in pom.xml: 我的理解是,Eclipse的Maven插件应自动管理这些库的下载,因此我检查以确保pom.xml中包含以下内容:

<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-webmvc</artifactId>
  <version>${org.springframework.version}</version>
</dependency>

<properties>
  <org.springframework.version>3.0.2.RELEASE</org.springframework.version>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>  

So how do I fix my application to enable the required dependencies to be available? 那么,如何修复应用程序以使所需的依赖关系可用? I want to avoid having to do it manually, because I was under the impression that maven should manage this. 我想避免不得不手动执行此操作,因为我的印象是Maven应该对此进行管理。 Is there some way that I need to manipulate maven? 我需要某种方式来操纵Maven吗? The application apparently worked when it was tested for the tutorial. 在针对本教程进行测试时,该应用程序显然可以正常工作。

EDIT: 编辑:

I converted my eclipse project to a maven project and then right clicked on the eclipse project and chose Maven>Update Project. 我将eclipse项目转换为maven项目,然后右键单击eclipse项目并选择Maven> Update Project。 This did nothing to fix the error that still remains from my original posting above, but it also added the following new error: 这并不能解决上面我原始帖子中仍然存在的错误,但是它还添加了以下新错误:

Missing artifact javax.transaction:jta:jar:1.0.1B  

Which is now thrown by the second line of pom.xml, which reads as follows: 现在,它由pom.xml的第二行引发,内容如下:

<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

SECOND EDIT: 第二编辑:

When I try to run as..run on server, I get the following error in a dialog box: 当我尝试在服务器上以..run身份运行时,在对话框中出现以下错误:

'Publishing to Tomcat v7.0 Server at localhost...' has encountered a problem.

Error reading file D:\mypath\.m2\repository\javax\transaction\jta\1.0.1B\jta-1.0.1B.jar
D:\mypath\.m2\repository\javax\transaction\jta\1.0.1B\jta-1.0.1B.jar (The system cannot find the file specified)  

I even set "update Maven projects on startup" in Window>preferences>Maven and then closed and restarted eclipse, but the problem persists. 我什至在Window> preferences> Maven中设置“启动时更新Maven项目”,然后关闭并重新启动Eclipse,但问题仍然存在。

I passed for this same issue where I receive the message 我因收到邮件的同一问题而通过

"cannot find tag library descriptor for ..."

I solved putting spring-webmvc inside of my war. 我解决了将spring-webmvc放入战争中的问题。 This error happened when spring-webmvc were in server folder. 当spring-webmvc位于服务器文件夹中时,发生此错误。

I suggest you see how do you're packaging your war. 我建议您看看您如何包装战争。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM