https://issues.apache.org/bugzilla/show_bug.cgi?id=52833

--- Comment #13 from Konstantin Kolinko <knst.koli...@gmail.com> 2012-03-20 
16:53:34 UTC ---
(In reply to comment #8)
(In reply to comment #9)

AbstractRunMojo#startContainer() creates a "new Catalina()". I do not see it
ever calling setParentClassLoader() and Catalina#parentClassLoader defaults to
its own classloader.

Is Catalina.class.getClassLoader() the one that does not have system CL in its
parents chain?


> What I don't understand is why in the parent classLoader chain having
> SystemClassLoader is mandatory!


Anyway as far as WebappClassLoader class goes

1) It has to follow its documentation, [1] in 7.0 and in more details in 5.5,
where shared class loader was actually used. There is lookup sequence,

"Therefore, from the perspective of a web application, class or resource
loading looks in the following repositories, in this order: (...)" - see [1]

[1] http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html


2) WebappClassLoader has its own explicit call to getSystemClassLoader() and
treats the system class loader specially and separately from its parent, to
follow its specific delegating pattern of calling
 A system CL
 B webapp CL
 C parent CL.

Therefore for the WebappClassLoader class it does not matter where its "parent
CL" is rooted. It does not impact its behaviour.

So using shared CL that does not have system CL as a parent does not seriously
impact Tomcat.

I do not mind a (cl != null) check to be added in the loop in r1242101.


It seems that the code in r1242101 is the first one that actually looks into
the shared classloader and is outside of a webapp. Such work is usually scoped
to the web application. The shared CL is actually used in
WebappLoader#createClassLoader().

See also my comments in "Re: r1242101" on dev@.
http://markmail.org/message/rgd7tzz5zks6l5wn

(In reply to comment #12)
> 
> Caused by: org.apache.catalina.LifecycleException: An invalid Lifecycle
> transition was attempted ([before_stop]) for component
> [org.apache.catalina.deploy.NamingResources@7f1f91ac] in state [INITIALIZED]

Interesting... A small issue though. It tries to stop a component that has not
been started?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to