I opened up firebug and noticed this:
Failed to load source for: http://localhost:8080/mymedAdmin/a4j/s/330.GAstylesheet/theme.xcss/DATB/eAHbdnRLUujyGdIAFdEEQQ
Any ideas why this is happening?
I'm getting closer, but still haven't fixed the problem...
My ear app seems to be loading its stylesheets fine. Here's an example path:
I noticed that the version is different, so I tried replacing all the richfaces jar, but somehow my path still shows a different version:
How do I get it to use version 322?
Still no luck...:(
The generated app works with same richfaces version.
<link class="component" type="text/css" rel="stylesheet" href="/mymed_2_1_2/a4j/s/3_3_0.GA/org/richfaces/skin.xcss/DATB/eAHbdnRLUujyGdIAFdEEQQ__"> //css is properly outputed here... </link>
My semi-generated app fails:
<link class="component" type="text/css" rel="stylesheet" href="/mymedAdmin/a4j/s/3_3_0.GA/org/richfaces/skin.xcss/DATB/eAHbdnRLUujyGdIAFdEEQQ__"> Failed to load source for: http://localhost:8080/mymedAdmin/a4j/s/3_3_0.GA/org/richfaces/skin.xcss/DATB/eAHbdnRLUujyGdIAFdEEQQ__ </link>
I replaced the following jars in my app:
Why does it load fine in the one app, and fails in the other?
The difference between the two apps, is that the one is an ear and the other is a war.
The war is not working properly.
I got the same problem, but I'm using only RichFaces over JSP (I'm sorry for that).
Did you get any solution for this issue????
The problem was caused by using a wildcard (*) to apply login required to all screens in my app. I changed it back to the normal configuration in pages.xml then the bug went away.
The drawback is that I had to specify login required per page.
I've just spent the last few hours debugging this and figured out the issue. We were hitting the same problem, but needed caching in production. Posting my notes for others.
Explanation of problem:
- Initial request for a Seam page comes in from from an unauthenticated user.
- As a result of page view-id="*" login-required="true" in pages.xml, Seam returns 302 / redirect, sends browser to Page B
- Page B contains references to richfaces resources (xcss, etc.) (Due to our usage of org.richfaces.LoadStyleStrategy [All], etc.)
- Due to these resource references in Page B, browser makes request for these resources (i.e. org/richfaces/renderkit/html/css/extended_both.xcss/DATB/eAHziU!XD10-QxoADOoC8Q__, etc.)
- User is still NOT authenticated at this point
- Request for resources goes into A4J's InternetResourceService.serviceResource()-> LRUMapCache.load() -> InternetResourceService.load()
- InternetResourceService.load() processes the JSF request lifecycle to render the resource, but in Seam's Pages.postRestore(), Seam responds with a redirect because this resource ALSO matches view-id="*" pattern and the user is still not yet authenticated
- This "response" from rendering the resource (really just a 302, contentLength of 0, garbage), is put into the LRUMapCache by A4J
- All subsequent requests for this resource (i.e. org/richfaces/renderkit/html/css/extended_both.xcss/DATB/eAHziU!XD10-QxoADOoC8Q__) return that garbage/cached value.
- Richfaces themes / resources / styles are gone until server is restarted
Fixes / Workarounds:
- Change richfaces code to recognize 503 / invalid responses and NOT cache them
- Disable a4j caching with <web:ajax4jsf-filter enable-cache="false".../>
- Change page view-id="*" login-required="true" so that it does not match a4j resource requests. (our current solution)
- Make sure that no page hit by an unauthenticated user ever contains richfaces resources (at least until an authenticated user has the same pages first)
Thank you for posting this. I've been going crazy trying to figure this out. Unfortunately I've been unable to implement your solutions. I don't know how to go about recognizing the 503 error in richfaces and disabling the caching, I'm not sure where to implement the line to disable the cache, my pages.xml already has the page view-id set to '*' and login-required is true and I am having this problem from the moment I start the server and so can't log in an authenticated user to set this up.
I can't believe this is the way it's supposed to be. I've done nothing interesting so this seems like a horrible flaw. Where did I go wrong and why isn't everyone having the same problem?
Hello, it's been a while, but let me see what I can dig up. Note that with the fixes / workarounds I mentioned in my last post, you only need to do _one_ of those.
- The first one I mentioned would be a code change to Richfaces, not optimal from a user perspective, you would want that to come from the Richfaces folks (unlikely at this point).
- To disable a4j caching, that can be done in components.xml, here is our entry:
- On the third workaround, in our pages.xml we made the following change. It makes it so that a4j resource requests don't get caught up in seam security (for better or worse):
<page view-id="*" login-required="true" />
<page view-id="/logon/*" login-required="true" />
<page view-id="/test/*" login-required="true" />
<page view-id="/layout/*" login-required="true" />
- The last workaround isn't realistic but I wanted to point it out because it's how the problem starts.
Thanks for your reply. I'll disable caching for now.
I was a little worried about the last option so it's comforting to know I am not totally hopeless. :)
i think i just solved this painfull issue with a very simple approach. Before i did the same as Richard mentioned and this worked well. I want to have the a4j cache etc. so i moved all pages with login into one folder ./s/*.
Now i just had the idea to create a wildcard viewid *.xhtml. Too bad that the the wildcard viewids need to end with a star.. But this seems to work well:
<page login-required="true" view-id="*.xhtml*" />
The only disadvantage is that all other files except xhtml are available without login, but this is something i can live with easily.
Can somebody please confirm this?
Forget my previous post. Pages implementation uses startsWith... for wildcard view ids
insert the page element at the beginning of your pages.xml and it will reload the css's.
<page view-id="/stylesheet/**" login-required="false"> <restrict>false</restrict> </page>