Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

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

User Guide
  - Korean
  - Chinese

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

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
Main
Tomcat5Logging
Tomcat5Logging_ko




JSPWiki v2.2.33

[RSS]


Hide Menu

Tomcat5Upgrade


This is version 17. It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]


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  
  org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor
  (LogFactoryImpl.java:432)
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
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" />        












Go to top   More info...   Attach file...
This particular version was published on 06-Nov-2006 13:52:38 MST by MattRaible.