Description
There is some code (mostly checked the facelets part yet) which is not aware of Multi-ClassLoader scenarios like one has in J2EE environments where MyFaces is installed inside the containers SharedClassLoader.
An example: if you look at MetaRulesetImpl, you will see
private final static WeakHashMap<String, MetadataTarget> _metadata = new WeakHashMap<String, MetadataTarget>();
Assuming that myfaces-impl.jar gets shared between multiple WebApps, this is utterly evil since this map only exists once for all WebApps.
I found this issue because I got weird ClassCastExceptions in my project which contains 2 WAR files in an EAR and those WAR files both contains primefaces.jar.
I first hit a page from webapp1 which loads Watermark.class via webapp1 WebAppClassLoader.
If you access a page from webapp2 after that and this also uses p:watermark, it will find the cached method for Watermark, but this still is the class loaded via the webapp1 ClassLoader. So on evaluating the EL it creates a ClassCastException because WaterMark loaded via ClassLoader of webapp1 != WaterMark loaded via ClassLoader of webapp2.
Attachments
Issue Links
- relates to
-
MYFACES-2942 Memory Leak in MyFaces 2.0.1 probably as well in 2.0.2
- Closed