https://bz.apache.org/bugzilla/show_bug.cgi?id=58143

--- Comment #2 from Violeta Georgieva <violet...@apache.org> ---
Hi,

Here are my comments:

The most obvious solution here is to clear
WebappClassLoaderBase.resourceEntries when a transformer is added but I have
some concerns about it.

When you are using TomcatInstrumentableClassLoader it is defined in context.xml
and this class loader will be used to load the classes from the very beginning
(please correct me if this is not the case from spring point of view)

When you are using TomcatLoadTimeWeaver (this bug) the transformer is added on
contextInitialed phase which, my opinion, is too late.
I think that this (TomcatLoadTimeWeaver) should be added on an earlier stage
(e.g. the loader created event or configure_start event). Otherwise:
- ServletContainerInitializers will work with non-transformed classes
- Annotations scanning will happen on non-transformed classes
- Depending on ServletContextListeners order, the listeners before Spring's one
will work with non-transformed classes

Why I think that clearing resourceEntries is not a good solution:
- There might appear ClassCastExceptions between components using
non-transformed and transformed classes.

Other solution will be to mark the loader as modified when a transformer is
added so that the context will be reloaded (if it supports reloadable).
This won't solve the Spring's case because they will add the transformer again
on the contextInitialized step and we will enter in never ending cycle.

Other opinions?

Regards,
Violeta

-- 
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