"Vjeran Marcinko" <[EMAIL PROTECTED]> writes:

>Hi folks.

>Current version of Turbine 2.3 doesn't work in Tomcat5 because Tomcat's
>classloader system uses commons-logging.jar and jmx.jar before looking into
>some .war (they call it system classpath which has higher priority than war
>libs). It wouldn't be a problem if Turbine's servlet doesn't use

I remember reading about this on http://www.hibernate.org/114.html

--- cut ---

This was expected, because Tomcat "sometimes" (actually, this is the
difference between the standard JDK classloader concept and the
"broken" Servlet specification) has a different delegation strategy
for its classloaders:

The classloader at the common/lib and common/classes level is not the
same as the context classloader, responsible for a specific
WEB-INF/lib and WEB-INF/classes. You would expect that every
loadClass(), new and Class.forName() call in your application results
in a search at the current level and then a delegation to the upper
level classloader if no class can be found. This is not the case! The
default is to first search with the parent classloader and if he can
not find the class, with its parent classloader. This chain of
responsibility continues up to the top of the classloader delegation
hierarchy. Only if no classloader in the chain can find your requested
class, your context classloader will get a chance to try it.

One way to modify this behaviour (and you usually want it different)
is to work with the <loader> directive in Tomcats server.xml (in the
declaration of each context):

<Loader checkInterval="1" delegate="false"/>

This turns on auto-reloading of classes (one second check time),
useful in development. It also prevents the delegation to the parent
classloader: The context classloader gets the first chance to find the
class for your application. The default of this attribute (true or
false) seems to vary from Tomcat version to version. Much of the
classloading problems in Tomcat (the broken commons-logging and log4j,
for example) stems from this simple fact.

--- cut ---

You might want to try "delegate="false". The "checkInterval" is a bad
idea for a production system (a good one for debugging, though).

Let me know if this works for you.

        Regards
                Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
[EMAIL PROTECTED]        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

"Fighting for one's political stand is an honorable action, but re-
 fusing to acknowledge that there might be weaknesses in one's
 position - in order to identify them so that they can be remedied -
 is a large enough problem with the Open Source movement that it
 deserves to be on this list of the top five problems."
                       -- Michelle Levesque, "Fundamental Issues with
                                    Open Source Software Development"

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to