-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PrimeFaces-served icons CSS fails to load after changing design #436
Comments
It looks like this specifically happens when you have |
In some initial investigation, it seems like the problem may be down to the way classes are loaded from the NSF. Currently, it's done via |
Turns out that wasn't the problem, but it's good to fix anyway. The actual exception is currently being squelched by the exception handler in NsfJsfServlet, which doesn't log the exception anywhere when it can't get a Writer (which is where the only log line is coming from). Changing the exception handler to log the full trace reveals:
|
My general theories have revolved around needing to close out older ClassLoaders at the right time, though that hasn't borne fruit. Still, it seems plausible: the Servlet#destroy method in NSFJsfServlet isn't called when modifying a force-reload resource and going to the page again, and so lingering bits remain. On the other hand, keeping a cache of CLs based on DB path and then closing an old one out didn't fix the trouble. In general, the problem could come from the fact that PrimeFaces uses its own FacesContextFactory, and this lingers around after the refresh. However, my initial test in that direction wasn't fruitful either: in the same check where I look for an orphaned ClassLoader, I also tried calling |
Similarly, calling |
This is weirdly fiddly. I've had no luck so far tracking down what might remain between discarded ClassLoaders. Looking at the FacesServlet and the objects it gets from the factory, they're all new instances, including the Prime ones. I also don't see anything stashed in the ServletContext (which is presumably reset) or in the HttpSession. |
Found the trouble: the CDI container isn't re-initialized with a Faces request post-refresh. Faces uses CDI internally to provide these objects, so they're being cached across requests within Weld. The root of this trouble is that CDI doesn't currently have a mechanism for invalidating containers outside of |
If the NSF is left alone, this generally works (as in the riekpil.de example), but opening the NSF or making a change that initializes a full app reload (e.g. re-saving faces-config.xml or a Java file) makes the resource fail until a server restart or, presumably, the app expires.
There's no error message in the response or on the console, though there's a logged message (without a trace) about trying to get a writer after already getting an output stream for the request - that implies that it could be squelching some other problem.
The fact that it only happens on a "full" app refresh makes me wonder if there's some aspect of it sticking around that causes trouble, like caches resources or the like. It'll be worth investigating whether the ServletContext and related elements really come in clean after a refresh.
The text was updated successfully, but these errors were encountered: