Raible's Wiki

Raible Designs
Wiki Home
Recent Changes


  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in

Edit this page

Referenced by

JSPWiki v2.2.33


Hide Menu


I attempted to upgrade my Tomcat 4.1.24-based application to Tomcat 5.0.2 this morning and found a few issues:

1. I had to put mail.jar and activation.jar into common/lib so my log4j's SMTPAppender would work. 2. I had to copy log4-*.jar into common/lib to workaround this error:

Caused by: org.apache.commons.logging.LogConfigurationException: No 
  suitable Log constructor [Ljava.lang.Class;@1d33a6b for 
  org.apache.commons.logging.impl.Log4JLogger at  
3. In one of my JSP's, I have:
<%@ page import="org.apache.struts.Globals" %>
<c:remove var="<%=Globals.ERROR_KEY%>" scope="request"/>
This works in Tomcat 4.1.x, but fails in Tomcat 5. Is this a bug in 4.1.x or 5.x?
org.apache.jasper.JasperException: /common/messages.jsp(12,4) 
  According to TLD or attribute directive in tag file, attribute 
  var does not accept any expressions


This may be old news, but for the sake of solving the issue for future generations:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>

4. None of my logging configuration in mywebapp/WEB-INF/classes/log4j.properties file is picked up. Even moving it to $CATALINA_HOME/common/lib does not seem to help.

Tomcat 5.0.3 (June 23, 2003)

Tomcat 5.0.3 came out today, so I again attempted an upgrade. But still no luck. I had to do steps 1 and 2 again to get my app to start, and also I removed the offending code in step 3. I also had to copy the commons-logging.jar from struts-rc2 to get Log4j's SMTP appender to work. However, the database drivers won't load in this release - making it even worse that 5.0.2.

Tomcat 5.0.4 (July 15, 2003)

Tomcat 5.0.4 Alpha was released today, and according to Dave it's a useable release. Unfortunately, I cannot get it to work out-of-the-box with AppFuse. I'm getting the my favorite error:

java.sql.SQLException: Cannot load JDBC driver class 'null'
This app works beautifully in Tomcat 4.1.24 and I can put the exact same directory, appfuse.xml and jdbc driver in common/lib and it works. I've sent a message to the tomcat-user group, but I'm not expecting a response as this question often goes unanswered.

Update 1: I found that adding log4j.jar to $CATALINA_HOME/common/lib solved my problem, but now I get the following error when I start Tomcat and there is no logging to catalina.out:

log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.Embedded).
log4j:WARN Please initialize the log4j system properly.
Solved no logging by adding my generated log4.properties file to $CATALINA_HOME/common/classes

Update 2: I had to put appfuse.xml in $CATALINA_HOME/conf/Catalina/localhost. So I guess the context.xml file must go in $CATALINA_HOME/conf/Catalina/localhost, rather than $CATALINA_HOME/webapps. Doh! Now I have to figure out a way to modify my "setup-tomcat" task to detect and deploy appropriately for Tomcat 5. Here is the relevant part:

<echo level="info">Copying ${webapp.name}.xml to ${tomcat.home}/webapps</echo>
<copy tofile="${tomcat.home}/webapps/${webapp.name}.xml"
            file="metadata/web/tomcat-context.xml" />        

Tomcat 5.0.5 (July 28, 2003)

Everything works the same as it did in Release 5.0.4 Alpha (above).

Tomcat 5.0.6 (August 4, 2003)

Everything works the same as it did in Release 5.0.5 Alpha (above). A did get a new error about parsing struts-menu.tld, but after looking at the logs, I discovered it's solved by putting log4j.jar in $CATALINA_HOME/common/lib.

To summarize - to install AppFuse (or StrutsResume) on Tomcat 5.0.4+, perform the following steps:

  • Run ant setup-tomcat, then mv $CATALINA_HOME/webapps/appfuse.xml $CATALINA_HOME/conf/Catalina/localhost/.
  • cp lib/jakarta-log4j*/dist/lib/log4j*.jar $CATALINA_HOME/common/lib/.
  • cp build/appfuse/WEB-INF/classes/log4j.properties $CATALINA_HOME/common/classes/.

Later: I discovered (with Remy's help) that if I removed privileged="true" from my <Context> definition - then my Log4j issues went away. I thought that parameter meant that the app used a Realm, but after reading the documentation (Set to true to allow this context to use container servlets, like the manager servlet), I realize that I'm using it incorrectly.

Go to top   Edit this page   More info...   Attach file...
This page last changed on 06-Nov-2006 13:52:59 MST by ScottDavis.