Problem running Spring 3 mvc-basic sample

2019-08-14 08:13发布

I am trying to get started with Spring 3, using Eclipse 3.6 and Spring STS. I have also installed m2eclipse. I have checked out and imported the Spring3 mvc-basic sample app.

When I try to run it (via eclipse/run/run on server) I get a number of errors in the webapp startup on tomcat, all relating to jstl1.2.jar:

org.apache.jasper.JasperException: Unable to read TLD "META-INF/c.tld" from JAR file "file:/home/myname/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/mvc-basic/WEB-INF/lib/jstl-1.2.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV

However:

jar -tf  /home/myname/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/mvc-basic/WEB-INF/lib/jstl-1.2.jar |grep c.tld

Yields:

META-INF/c.tld

So I am having difficulty in understanding the error

Any help greatly appreciated.

Rob

1条回答
倾城 Initia
2楼-- · 2019-08-14 08:44

It seems that there is problem when running project from eclipse. The solution is to comment following libraries in pom.xml - servet-api and jsp-api. Tested both with tomcat 6 and 7

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.1</version>
        <scope>provided</scope>
    </dependency>
查看更多
登录 后发表回答