Java

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • SV: Turbine 2.3.0/Commons-Logging configuration under Tomcat 5.5

    0 answers - 6220 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hi all,
    many thanks to David, Juergen and Thomas for their input in December (!).
    Your comments assured me that I needed to look somewhere deeper to find the
    root of this problem.
    The problem seems to stem from Turbine.java in Turbine 2.3.0 where the
    configure() method explicitly requires
    from commons-logging-1.0.x.jar.
    Log4jFactory has been removed from commons-logging-1.1 and from what I can
    understand, Tomcat 5.5 requires commons-logging-1.1. This caused a conflict
    that I was unable to resolve with configuration tools only.
    My only option was to upgrade from Tomcat 2.3.0 to Tomcat 2.3.2 which, as
    noted in the release history
    Turbine no longer configures the logging factory for commons-logging
    explicitly. If you relied on this behaviour, you must add a
    commons-logging.properties file to your application as described in the
    commons logging documentation
    <<<<<<<<<<<<<<<<
    The upgrade was painless (thus far) requiring only that the
    turbine-2.3.2.jar and all of its dependencies
    ()
    replaced their counterparts from Turbine 2.3.0.
    The only glitch was that WEB-INF/build/build.properties had to be adjusted
    by ensuring that the following properties were correctly set (they were
    previously commented out):
    torque.database.buildUrl =
    torque.database.driver = com.mysql.jdbc.Driver
    torque.database.user = myappuser
    torque.database.password = myapppassword
    Note that since the upgrade from MySQL 4.0.x to 5.0.x, I had to replace
    mm-mysql-2.0.13-bin.jar with which has
    the org.gjt.mm.mysql.Driver only as a dummy extension of
    com.mysql.jdbc.Driver for backwards compatability. Thus the change in
    database.driver above.
    For the moment, the documented
    () default log4j
    configuration seems to work for me. The
    file reads:
    log4j.rootLogger=ERRR, R
    log4j.appender.R.File=${catalina.home}/logs/tomcat.log
    %p %t %c - %m%n
    , R
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    This seems to work fine when I have commons-logging-1.1.jar and
    log4j-1.2.14.jar in tomcat5.5/common/lib, which means that they are not
    needed in myapp/WEB-INF/lib.
    Please let me know if there are any issues that any of you have experienced
    when going from Turbine 2.3.0 to Turbine 2.3.2.
    Thanks for all the help!
    /Martin
    meddelande
    F: David Demner [mailto:turbine2 (AT) demner (DOT) com]
    Skickat: den 9 december 2006 04:01
    Till: 'Turbine Users List'
    : RE: Turbine 2.3.0/Commons-Logging configuration under Tomcat 5.5
    Martin,
    I've also found that rogue log4j jar files (in WEB-INF/lib, or tomcat's
    common/lib, server/lib, or shared/lib) can cause this double initialization.
    Good luck,
    David
    Message
    From: Martin Lidgard [mailto:martin (AT) arkatay (DOT) com]
    Sent: December 8, 2006 1:04 AM
    To: 'Turbine Users List'
    Subject: Turbine 2.3.0/Commons-Logging configuration under Tomcat 5.5
    Hello,
    I am working on upgrading our hosting environment from Tomcat 4.1 to Tomcat
    5.5. In our current Tomcat 4.1 environment we are running Turbine 2.3
    (2.3.0, not 2.3.2) with commons-logging-1.0.4 and log4j-1.2.8 using more or
    less the default logging configuration from Turbine. When upgrading to
    Tomcat 5.5 the logging does not work as intended.
    Logging is written to the webapp's local log as expected during startup,
    with logging level DEBUG for the log4j.logger.myapp entry:
    myapp.log (22817 bytes)
    scheduler.log (127 bytes)
    torque.log (0 bytes)
    turbine.log (0 bytes)
    velocity.log (0 bytes)
    Initialization logging is written to /var/log/tomcat/catalina.out, showing
    among other things an init of Log4j:
    []
    log4j: Parsing for [root] with value=[DEBUG, console, myapp].
    log4j: Level token is [DEBUG].
    log4j: Category root set to DEBUG
    log4j: Parsing appender named "console".
    log4j: Parsing layout options for "console".
    log4j: Setting property [conversionPattern] to [%-5r %-5p %-25.25c{1} -
    %m%n].
    log4j: End of parsing for "console".
    log4j: Setting property [threshold] to [DEBUG].
    log4j: Parsed "console" options.
    log4j: Parsing appender named "myapp".
    log4j: Parsing layout options for "myapp".
    log4j: Setting property [conversionPattern] to [%d %-5p %c{1} - %m%n].
    log4j: End of parsing for "myapp".
    log4j: Setting property [append] to [true].
    log4j: Setting property [file] to
    [/].
    log4j: Setting property [threshold] to [DEBUG].
    log4j: setFile called: /, true
    log4j: setFile ended
    log4j: Parsed "myapp" options.
    []
    After a number of lines of log messages in catalina.out describing
    initialization of Turbine services, there seems to be a second Log4j
    initialization using the same configuration as above.
    After this, debug messages that are specific to the initialization of
    "myapp" are written to both catalina.out and webapps/myapp/logs/myapp.log,
    as expected.
    However, when performing the first request to the servlet, no further debug
    logging is written to either catalina.out or myapp.log. INF
    logging is written to catalina.out describing the late initialization of the
    Turbine services.
    Is Log4j reconfigured somehow during the request without telling? Could
    there be a link missing between Tomcat's request and the logging? Any ideas
    or sample configurations would be greatly appreciated.
    Thanks,
    Martin
    To unsubscribe, e-mail: turbine-user-unsubscribe (AT) jakarta (DOT) apache.org
    For additional commands, e-mail: turbine-user-help (AT) jakarta (DOT) apache.org
    To unsubscribe, e-mail: turbine-user-unsubscribe (AT) jakarta (DOT) apache.org
    For additional commands, e-mail: turbine-user-help (AT) jakarta (DOT) apache.org
    To unsubscribe, e-mail: turbine-user-unsubscribe (AT) jakarta (DOT) apache.org
    For additional commands, e-mail: turbine-user-help (AT) jakarta (DOT) apache.org

Re: SV: Turbine 2.3.0/Commons-Logging configuration under Tomcat 5.5


max 4000 letters.
Your nickname that display:
In order to stop the spam: 2 + 2 =
QUESTION ON "Java"

EMSDN.COM