Announcement Announcement Module
Collapse
No announcement yet.
Petclinic: Unable to read TLD "META-INF/c.tld" Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Petclinic: Unable to read TLD "META-INF/c.tld"

    Hi,

    I have downloaded the petclinic source from the trunk svn. With mvn package I have create the war file as well.

    Now when starting it under Tomcat 6.0.24 I am getting this exception:
    org.apache.jasper.JasperException: /WEB-INF/jsp/uncaughtException.jsp(1,1) Unable to read TLD "META-INF/c.tld" from JAR file "file:/D:/Blistering/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/org.springframework.samples.petclinic/WEB-INF/lib/com.springsource.javax.servlet.jsp.jstl-1.2.0.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV

    I can see that the com.springsource.javax.servlet.jsp.jstl-1.2.0.jar is in the war file.

    Does somebody know how to solve this problem?

    Thanks Tai

  • #2
    me too...

    Hi,

    I am having a very similar problem.

    Using STS 2.3.2. Created a project using : New -> Project -> SpringSourceToolSuite -> SpringTemplateProject -> SpringMVCProject

    When I RunAs -> RunOnServer -> SpringSourceTcServer6.0, I get basically the same error message.
    I also tried creating a SpringWebFlow project (via New -> Project -> SpringSourceToolSuite -> SpringTemplateProject), and that also has the same problem.

    Surely, this should be pretty basic stuff, right??

    Any idea would be greatly appreciated.

    Cheers,
    Gareth

    Comment


    • #3
      When deploying the war file directly under tomcat it works fine. But running the petclinic project inside eclipse it just fails.

      I have also tried to rename the project from org.springframework.samples.petclinic to petclinic but that didn't help either.

      Comment


      • #4
        I tried to copy com.springsource.org.apache.taglibs.standard-1.1.2.jar to \apache-tomcat-6.0.26\lib but the same problem appears.

        This looks like a classloading problem with eclipse. Also copying org.springframework.instrument.tomcat-3.0.0.RELEASE.jar into tomcat's lib folder and modifying petclinic's context.xml by using a tomcat class loader didn't help.

        What annoys me is that the petclinic.war running outside eclipse/directly under tomcat is just working fine.

        Tai

        Comment


        • #5
          Hi,

          as you say, it's frustrating that manually deploying the war file works ok (though, I guess it's better than not working at all!).

          What I don't understand though, is how there aren't hundreds of people all experiencing the same problem!

          Last week, I managed to get one of the examples from the "Spring Recipes" book working, using Spring 2.5. I did this by creating a "Dynamic Web Project", and manually added the various libraries.

          My problems started when using a "Spring Template Project". I'm (obviously) new to Spring, and also to Maven... and I suspect it's the latter where the problem lies.

          Anyway, I am just about to start another day of trying to get to grips with this stuff. Hopefully, today will be less frustrating...

          Gareth

          Comment


          • #6
            Try downgrading jstl version to 1.1.2

            Comment


            • #7
              Did anyone find a way around this?

              Originally posted by elixirsol View Post
              Using STS 2.3.2. Created a project using : New -> Project -> SpringSourceToolSuite -> SpringTemplateProject -> SpringMVCProject

              When I RunAs -> RunOnServer -> SpringSourceTcServer6.0, I get basically the same error message.
              <snip>
              Surely, this should be pretty basic stuff, right??
              Absolutely! I checked out a couple of samples from the SpringSource SVN repository and tried running them with the STS-provided tcServer, and got this error. I've tried all sort of variations of Maven builds (on command line and using m2eclipse functionality) but to no effect.

              I'm the first to admit that I've been mollycoddled with IDEs and servers that "just work" without me having to run builds and manually deploy WARs etc. I'm happy to learn this stuff. But it seems to me that if SpringSource is going to all this effort to convert their sample projects to Maven and to create STS with a one-click installation of Tomcat, we really shouldn't be getting stuck at this point! At least there could be slightly more help in the README?

              Comment


              • #8
                I met the same problem with other spring's web-app.

                If project is built by maven try change dependency scope to provided for jars : servlet-api and jsp-api
                Code:
                <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>
                and build project by maven.

                If you run project by eclipse remove 2 jars from path below
                Code:
                WORKSPACE/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/PROJECT_NAME/WEB-INF/lib
                or in settings tell eclipse to not add 2 jars to app.war

                Comment


                • #9
                  I gotta say this is ridiculous. I have tried everything to make a simple template work, and it just doesn't. I am using Helios with the nightly build of STS installed. I create a template project and it first complains about <resources> in the XML configuration, then I get this exact same problem at deployment. I've even created brand new workspaces.

                  The solution about changing the scope to provided is moot because that's thew ay it shows up already from the template. I'm losing patience with STS entirely.

                  Comment


                  • #10
                    Checkout the code from trunk repo of petclinic repo https://anonsvn.springframework.org/svn/spring-samples

                    Right click on the project -> run on server -> springsource tc server works like a charm!

                    Comment


                    • #11
                      Nope. That won't solve the problem. You are assuming that I'm using STS distro of Eclipse.

                      I am using Helios + STS from the update site. As it turns out, the base distro of Eclipse does not contain the same Maven plugins as the STS distro. The default plugin for Eclipse does not seem to honor the scope of a dependency, therefore it always deploys jsp-api even if you tell it that it is "provided". This causes problems with Tomcat (or compatible servers) at runtime.

                      The solution was to install "Maven Integration for Eclipse (Extras) 0.10.0.". This added the missing parts to Maven. I also installed Maven 2.2.1 on my machine and told Eclipse to use that Maven instead of the embedded one.

                      This solved the problem about deployments. The <resources> element will hopefully be resolved in a future STS release.

                      Comment


                      • #12
                        You are right. I was assuming you are using STS.

                        Comment


                        • #13
                          Torczuk got it

                          Hi

                          Torczuk gave me the right idea. From within the project properties/JEE Module Dependencies unselect both libraries mentioned by him and it'll work. @Torczuk: Thanks a lot! Apparently, Eclipse Maven Integration doesn't respect the Maven scope yet. Thus the manual step

                          Comment


                          • #14
                            Another way to get it run smoothly in Eclipse Helios is to generate a new Project Configuration with mvn (the console tool, not the plugin).

                            First, delete the eclipse configuration files .classpath, .project and the .settings directory, then execute mvn eclipse:eclipse -Dwtpversion=2.0 in the project directory.

                            In Eclipse, then right-click the project and select "refresh". E voilá, it will run perfectly. If you take a look at Deployment Assembly in the project configuration now, you will see, that the two jars that are provided are not included anymore.

                            I use this trick for other projects too, since the eclipse maven plugin still has some flaws and often fails to make a proper eclipse configuration.

                            Comment

                            Working...
                            X