You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Joe <jo...@hotmail.com> on 2007/05/25 17:37:57 UTC

Upgrading to Tomcat 6 problems

Hello, I just upgraded to Tomcat 6.0.13 from 5.5.9 (no particular reason for the upgrade, just keeping up to date).  I am running Java 1.6.  However, instantly I'm having trouble that I cannot resolve regardless of endless hours of searching for and trying to apply answers to previous similar problems.  After starting Tomcat, I get the following errors within the log file for every web application:

===== Start =====
INFO: Exception initializing TldLocationsCache: XML parsing error on file /WEB-INF/web.xml: (line 19, col -1): Element type "web-app" is not declared
===== End =====

The (line 19, col-1) is different per web app, but this particular line is interesting in that it is an error from the "manager" app web.xml file itself.  Generally, to resolve problems with tomcat, I refer to the manager app, etc. figuring this one, if any, will be correct.   I tried adding the DOCTYPE entry to the web.xml with no success.  I updated the <web-app> tag to the version 2.5 as in manager/WEB-INF/web.xml for all my apps.  

It is simply an "INFO" problem, but none of my web apps work.   I am wondering if it has something to do with the change from using "common" and "shared".  I heavily relied on "shared", but decided to go ahead and change to using "lib".  Should I change catalina.properties to go back to using shared?  However, the problem I have when trying to access a web app is universally:

===== Start =====
org.apache.jasper.JasperException: This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application

===== End =====

This undoubtedly comes from hitting the app's "index.jsp" which references the jstl core libs the same way as I have been doing it since I can't remember when.  Here is the line in my "index.jsp" file.

===== Start =====
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>

===== End =====

I did hit one email suggesting it should be http://java.sun.com/jsp/jstl/core, but that didn't fix it either.  Same error, except it said the uri (http://java.sun.com/jsp/jstl/core) cannot be resolved....

I have no idea if these two are related, but suddenly tomcat can't seem to find the JSTL stuff, even though JSTL.JAR and STANDARD.JAR are in the lib directory.  Some posts suggest to put JSTL.JAR and STANDARD.JAR into every web app's WEB-INF/lib directory, but I don't agree.  The truth is, the lib directory ( or shared ) is supposed to be used for this exact thing... that is, libraries, etc. used by ALL applications..  This is, then, the location where I put my java framework jar, my common web apps jar, and the common TLD files, etc.  I also modify the conf/web.xml to reference common servlets, tag libs and everything else.  Here is the entry from within the conf/web.xml referencing the core jstl taglibs:

===== Start =====
  <taglib>
    <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
    <taglib-location>lib/tld/c.tld</taglib-location>
  </taglib>

===== End =====

Please note... I'm not terribly sure right now that "lib/tld/c.tld" is the correct path ( now that I've changed to using "lib" instead of "shared" ).  The structure of my web apps is the default:

===== Start =====
webapps/app
===== End =====

My initial thinking was that maybe I needed the entry to be:

===== Start =====
  <taglib>
    <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
    <taglib-location>../../lib/tld/c.tld</taglib-location>
  </taglib>

===== End =====

However, this did not work either, nor any meaningful combination of it.  So, what am I missing?

Joseph Morgan
josephmmorgan@hotmail.com



Re: Upgrading to Tomcat 6 problems

Posted by Rashmi Rubdi <ra...@gmail.com>.
On 5/25/07, Joe <jo...@hotmail.com> wrote:
> Hello, I just upgraded to Tomcat 6.0.13 from 5.5.9 (no particular reason for the upgrade,
> just keeping up to date).  I am running Java 1.6.  However, instantly I'm having trouble that > I cannot resolve regardless of endless hours of searching for and trying to apply answers > to previous similar problems.  After starting Tomcat, I get the following errors within the
> log file for every web application:


I've upgraded from 5.5.x to 6.0.x with no problems at all, and I use JSTL also.

I recommend getting a ~fresh~ install of Tomcat 6.0.13 .

Then simply configure your webapps with their respective <Context> xml files

Tomcat 6.0.13 supports Servlet 2.5 specification and JSP 2.1 specification.

The EL requires your web.xml to be conformant to either Servlet 2.5 or
Servlet 2.4 specifications.

So in your web app's WEB-INF/web.xml  , make sure you have define
web-app exactly as:

one of the two:

<?xml version="1.0"?>
<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 web-app_2_5.xsd"
         version="2.5">

<!-- define other elements in correct order, as expected by the schema -->

</web-app>


OR

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

<!-- define other elements in correct order, as expected by the schema -->

</web-app>


If you're using JSTL 1.1 or higher there's no need to explicitly
define the TLDs within web.xml , as they're already defined in JSTL's
jar file. You just need the correct jstl and standard jar files.

In your JSPs make sure the taglib URIs are correct, (refer to the JSTL
Taglib API for your version of JSTL)

-Regards
Rashmi

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org