CodeMed
CodeMed

Reputation: 9191

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:

<%@ 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:

<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. Is there some way that I need to manipulate 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. 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:

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

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

Upvotes: 0

Views: 14639

Answers (1)

Ivan Rodrigues
Ivan Rodrigues

Reputation: 469

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. This error happened when spring-webmvc were in server folder.

I suggest you see how do you're packaging your war.

Upvotes: 1

Related Questions