Results 1 to 8 of 8

Thread: org.apache.jasper.JasperException

  1. #1
    Join Date
    Apr 2008
    Posts
    3

    Default org.apache.jasper.JasperException

    Hello, I try to learn springframework by following the tutorial

    Here is my config:
    * apache-tomcat-6.0.26
    * springframework 2.5.1

    The jar located into my WEB-INF / lib are the following:

    * commons-logging.jar
    * jstl-impl-1.2.jar
    * jsp-api.jar
    * junit-4.7.jar
    * junit-4.7-src.jar
    * junit-dep-4.7.jar
    * servlet-api.jar
    * spring.jar
    * spring-web.jar
    * spring-webmvc.jar
    * spring-webmvc-portlet.jar
    * spring-webmvc-struts.jar


    Here is my error :
    Code:
    org.apache.jasper.JasperException: /index.jsp(1,1) Unable to read TLD "META-INF/c.tld" from JAR file "file:/C:/Documents%20and%20Settings/Vincent%20Armelin.DG7LX44J/j2EE/springapp/apache-tomcat-6.0.26/webapps/springapp/WEB-INF/lib/jstl-impl-1.2.jar": org.apache.jasper.JasperException: Impossible de charger ou d'instancier la classe TagLibraryValidator: org.apache.taglibs.standard.tlv.JstlCoreTLV
    	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
    	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
    	org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:297)
    	org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:330)
    	org.apache.jasper.compiler.Parser.parseDirective(Parser.java:438)
    	org.apache.jasper.compiler.Parser.parseElements(Parser.java:1393)
    	org.apache.jasper.compiler.Parser.parse(Parser.java:130)
    	org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
    	org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
    	org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:185)
    	org.apache.jasper.compiler.Compiler.compile(Compiler.java:347)
    	org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
    	org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
    	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    spring-servlet.xml

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
     
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
     
    <!-- the application context definition for the springapp DispatcherServlet -->
     
     
        <bean id="productManager" class="springapp.service.SimpleProductManager">
            <property name="products">
                <list>
                    <ref bean="product1"/>
                    <ref bean="product2"/>
                    <ref bean="product3"/>
                </list>
            </property>
        </bean>
     
        <bean id="product1" class="springapp.domain.Product">
            <property name="description" value="Lamp"/>
            <property name="price" value="5.75"/>
        </bean>
            
        <bean id="product2" class="springapp.domain.Product">
            <property name="description" value="Table"/>
            <property name="price" value="75.25"/>
        </bean>
     
        <bean id="product3" class="springapp.domain.Product">
            <property name="description" value="Chair"/>
            <property name="price" value="22.79"/>
        </bean>
     
        <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
            <property name="basename" value="messages"/>
        </bean>
     
        <bean name="/hello.htm" class="springapp.web.InventoryController">
            <property name="productManager" ref="productManager"/>
        </bean>
     
        <bean name="/priceincrease.htm" class="springapp.web.PriceIncreaseFormController">
            <property name="sessionForm" value="true"/>
            <property name="commandName" value="priceIncrease"/>
            <property name="commandClass" value="springapp.service.PriceIncrease"/>
            <property name="validator">
                <bean class="springapp.service.PriceIncreaseValidator"/>
            </property>
            <property name="formView" value="priceincrease"/>
            <property name="successView" value="hello.htm"/>
            <property name="productManager" ref="productManager"/>
        </bean>
     
        <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
            <property name="prefix" value="/WEB-INF/jsp/"/>
            <property name="suffix" value=".jsp"/>
        </bean>
     
    </beans>
    web.xml

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
     
    <web-app version="2.4"
             xmlns="http://java.sun.com/xml/ns/j2ee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
             http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
     
      <servlet>
        <servlet-name>springapp</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>
     
      <servlet-mapping>
        <servlet-name>springapp</servlet-name>
        <url-pattern>*.htm</url-pattern>
      </servlet-mapping>
     
      <welcome-file-list>
        <welcome-file>
          index.jsp
        </welcome-file>
      </welcome-file-list>
      
      
    <jsp-config>
        <taglib>
          <taglib-uri>/spring</taglib-uri>
          <taglib-location>/WEB-INF/tld/spring-form.tld</taglib-location>
        </taglib>
      </jsp-config>
    </web-app>
    thank you for help

  2. #2
    Join Date
    Oct 2006
    Posts
    228

    Default

    Bit of a guess but I think JSTL 1.2 requires JSP 2.1, so try updating the web.xml to point at Servlet 2.5 instead of 2.4.

    Code:
    <web-app xmlns="http://java.sun.com/xml/ns/javaee" 
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    	version="2.5">

  3. #3
    Join Date
    Oct 2006
    Posts
    228

    Default

    Also you shouldn't deploy servlet-api.jar and jsp-api.jar with your web app since they are provided by the application server.

  4. #4
    Join Date
    Apr 2008
    Posts
    3

    Default

    It is weird cause when I remove the two libraries from my WEB-INF/lib:
    jsp-api.jar
    servlet-api.jar

    and I launch the application into my tomcat 6, I end up with:
    org.springframework.web.util.NestedServletExceptio n: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config

    When I take a look intyo apache 6 / lib they are both present.
    any explanation?

  5. #5
    Join Date
    Oct 2006
    Posts
    228

    Default

    Well neither servlet-api.jar or jsp-api.jar would contain that class, it is part of the jstl api, so you need to get the jstl 1.2 jar file (probably available as a separate download from whereever you got the jstl-impl-1.2.jar file from.

  6. #6
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,796

    Default

    I wrote a tutorial

    Spring Web MVC - Spring Web Flow Working With JasperReports

    there you going to see the jars used by me, therefore do a comparison against your list

    Soon I going to post the source code, after of my third hard disk crashed, I found the source code

    HTH

    -Manuel
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

  7. #7
    Join Date
    Oct 2006
    Posts
    228

    Default

    This has nothing to do with Jasper Reports. Jasper is the JSP compilation engine used by Tomcat...

  8. #8
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,796

    Default

    This has nothing to do with Jasper Reports. Jasper is the JSP compilation engine used by Tomcat...
    I share such link only to let him compare the jar list and of course how posible reference about report

    Anyway since our friend use springframework 2.5.x
    and according your stacktrace error
    org.springframework.web.util.NestedServletExceptio n: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
    your missing jar is
    \spring-framework-2.5.X\lib\j2ee\jstl.jar

    HTH
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •