Please file JIRA's and patches if at all possible. I'm actually wondering if
some of your descriptions are the causes of:

https://issues.apache.org/jira/browse/CXF-2286
https://issues.apache.org/jira/browse/CXF-1816

If we can get your patches in, it would be good to recheck those to see if
they are then fixed.

Don't immediately seem related but may be.

Whenever cxf is on server classpath and webapps use cxf any static instance variable in cxf classes can potentially cause issues with hot- deploy and pergen issues..

Probable Causes:
- org.apache.cxf.common.util.ASMHelper.LOADER_MAP

This map continues to have reference to classes generated and used
by the now undeployed webapp meaning the webapp classloader never
goes away.
The implementation of this map although weak is not weak enough,
because if a entry references a key (it seems to) then the key
although it is a WeakReference never goes away and therefore neither
does the entry (the classloader).

OK.   Makes sense.

I have patch for this one, not test case though.


- org.apache.cxf.jaxb.JAXBDataBinding.JAXBCONTEXT_CACHE

Here is appears we have another map the maintains references to the
generated classes and in turn to the webappClassloader that is no
more expect this one doesn't even try to be weak.  I notice there is
a clearCaches() method but i'm unsure about using that at anytime in
runtime because even though i'm taking down one cxf Service there
may be user services alive using jaxb at the same time.

The clearCaches is just there for use in the unit tests where we want to make
100% sure the caches are cleared out before a test runs.

Ok, so i won't use this as a solution then it seems....


Definitely check this with trunk and even the latest 2.1.x code on the 2.1.x branch. I believe the JAXBCONTEXT_CACHE stuff has gone through a couple iterations, just not exactly sure when each of the iterations occurred. It's currently using a CacheMap which does use weak keys, but the JAXBContext it holds in the value probalby holds the same Class objects and thus suffers the same problem as the ASM thing you mentioned. Patches would be good. :-)

Will do. No patch for this one yet, but if it's the same as the other issue above then should be pretty easier.

If you have any thoughts on unit testing either of these then please let me know..

thanks!

Dan

Reply via email to