Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

I have been facing this problem.....

Thread view: 
suchi - 16 Nov 2006 15:23 GMT
HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented
it from fulfilling this request.

exception

org.apache.jasper.JasperException: The absolute uri:
http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml
or the jar files deployed with this application
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

root cause

org.apache.jasper.JasperException: The absolute uri:
http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml
or the jar files deployed with this application
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:114)
    org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:316)
    org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:147)
    org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:423)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1552)
    org.apache.jasper.compiler.Parser.parse(Parser.java:126)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

note The full stack trace of the root cause is available in the Apache
Tomcat/5.5.17 logs.

--------------------------------------------------------------------------------

Apache Tomcat/5.5.17

My JSP like:

<%@ page contentType="text/html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
 <head>
   <title>JSP is Easy</title>
 </head>
 <body bgcolor="white">

   <h1>JSP is as easy as ...</h1>

   <%-- Calculate the sum of 1 + 2 + 3 dynamically --%>
   1 + 2 + 3 = <c:out value="${1 + 2 + 3}" />

 </body>
</html>

My Web.xml like:

<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app 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"
   version="2.4">

 <!-- Used by the JSTL I18N actions -->
 <context-param>
   <param-name>
     javax.servlet.jsp.jstl.fmt.fallbackLocale
   </param-name>
   <param-value>
     en
   </param-value>
 </context-param>

 <!-- Used by the JSTL database actions -->
 <context-param>
   <param-name>
     javax.servlet.jsp.jstl.sql.dataSource
   </param-name>
   <param-value>
     jdbc:mysql:///test,org.gjt.mm.mysql.Driver
   </param-value>
 </context-param>

 <!-- Used by the ResourceManagerListener in Chapter 19  -->
 <context-param>
   <param-name>driverClass</param-name>
   <param-value>
     org.gjt.mm.mysql.Driver
   </param-value>
 </context-param>

 <context-param>
   <param-name>jdbcURL</param-name>
   <param-value>
     jdbc:mysql:///test
   </param-value>
 </context-param>

 <!-- Filter and listener configurations for Chapter 19 -->
 <filter>
   <filter-name>accessControl</filter-name>
   <filter-class>
     com.ora.jsp.servlets.AccessControlFilter
   </filter-class>
   <init-param>
     <param-name>loginPage</param-name>
     <param-value>/ch19/login.jsp</param-value>
   </init-param>
 </filter>

 <filter-mapping>
   <filter-name>accessControl</filter-name>
   <url-pattern>/ch19/protected/*</url-pattern>
 </filter-mapping>

 <listener>
   <listener-class>
     com.ora.jsp.servlets.ResourceManagerListener
   </listener-class>
 </listener>

 <listener>
   <listener-class>
     com.ora.jsp.servlets.SessionCounterListener
   </listener-class>
 </listener>

 <!-- Servlet for showing JSP source. NOTE! Remove this in production
-->
 <servlet>
   <servlet-name>jspSource</servlet-name>
   <servlet-class>JSPSourceServlet</servlet-class>
 </servlet>

 <servlet-mapping>
   <servlet-name>jspSource</servlet-name>
   <url-pattern>/jspSource/*</url-pattern>
 </servlet-mapping>

 <!-- Example servlets, see Chapter 19 -->
 <servlet>
   <servlet-name>helloWorld</servlet-name>
   <servlet-class>HelloWorld</servlet-class>
 </servlet>

 <servlet-mapping>
   <servlet-name>helloWorld</servlet-name>
   <url-pattern>/hello/*</url-pattern>
 </servlet-mapping>

 <servlet>
   <servlet-name>helloYou</servlet-name>
   <servlet-class>HelloYou</servlet-class>
 </servlet>

 <servlet-mapping>
   <servlet-name>helloYou</servlet-name>
   <url-pattern>/helloYou/*</url-pattern>
 </servlet-mapping>

 <servlet>
   <servlet-name>helloMIME</servlet-name>
   <servlet-class>HelloMIME</servlet-class>
 </servlet>

 <servlet-mapping>
   <servlet-name>helloMIME</servlet-name>
   <url-pattern>/helloMIME/*</url-pattern>
 </servlet-mapping>

 <!-- Struts Controller servlet, see Chapter 19 -->
 <servlet>
   <servlet-name>action</servlet-name>

<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
   <load-on-startup>1</load-on-startup>
 </servlet>

 <servlet-mapping>
   <servlet-name>action</servlet-name>
   <url-pattern>*.do</url-pattern>
 </servlet-mapping>

 <!-- The Welcome File List -->
 <welcome-file-list>
   <welcome-file>index.html</welcome-file>
   <welcome-file>index.jsp</welcome-file>
 </welcome-file-list>

<!--
 Uncomment if you want all exceptions to be handled by the customized
 error page.
 <error-page>
   <exception-type>java.lang.Throwable</exception-type>
   <location>/ch9/errorpage.jsp</location>
 </error-page>
-->

 <!--
   This resource reference is only used to test the JNDI config
described
   in Chapter 23. None of the examples use it.
 -->
 <resource-ref>
   <description>
     JNDI DataSource for example database
   </description>
   <res-ref-name>jdbc/Example</res-ref-name>
   <res-type>javax.sql.DataSource</res-type>
   <res-auth>Container</res-auth>
   <res-sharing-scope>Sharable</res-sharing-scope>
 </resource-ref>

 <!-- Security constraints for examples in Chapter 13 -->
 <security-constraint>
   <web-resource-collection>
     <web-resource-name>admin</web-resource-name>
     <url-pattern>/ch13/admin/*</url-pattern>
     <url-pattern>/ch13/search/delete.jsp</url-pattern>
   </web-resource-collection>
   <auth-constraint>
     <role-name>admin</role-name>
   </auth-constraint>
 </security-constraint>

 <security-constraint>
   <web-resource-collection>
     <web-resource-name>search</web-resource-name>
     <url-pattern>/ch13/search/*</url-pattern>
   </web-resource-collection>
   <auth-constraint>
     <role-name>admin</role-name>
     <role-name>user</role-name>
   </auth-constraint>
 </security-constraint>

 <login-config>
   <auth-method>BASIC</auth-method>
   <realm-name>ORA Examples</realm-name>
 </login-config>

 <security-role>
   <role-name>admin</role-name>
 </security-role>
 <security-role>
   <role-name>user</role-name>
 </security-role>

</web-app>

Anyone has any idea???? Please reply back as soon as
possible...........
Thank you
Manish Pandit - 16 Nov 2006 17:58 GMT
Hi,

1. Make sure you copy the tld files from the JSTL archive to WEB-INF
folder of your application.

2.  Add this to the web.xml
 <taglib>
   <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
   <taglib-location>/WEB-INF/fmt.tld</taglib-location>
 </taglib>
 <taglib>
   <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
   <taglib-location>/WEB-INF/c.tld</taglib-location>
 </taglib>
 <taglib>
   <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
   <taglib-location>/WEB-INF/sql.tld</taglib-location>
 </taglib>
 <taglib>
   <taglib-uri>http://java.sun.com/jstl/x</taglib-uri>
   <taglib-location>/WEB-INF/x.tld</taglib-location>
 </taglib>

-cheers,
Manish


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.