-
1. Re: Files built by RichFaces resources plugin not found
michpetrov Jun 25, 2013 5:23 AM (in response to tarnschaf)Hi,
I don't quite understand what's happening
… only JBoss then tries to load them from another resource folder and fails.
you mean the server throws an exception? Can you show me the stacktrace?
It is possible to put the resource in the /resources folder but I haven't found yet out how to make the browser look for them there.
-
2. Re: Files built by RichFaces resources plugin not found
tarnschaf Jun 25, 2013 6:56 AM (in response to michpetrov)Hi,
thanks for the response.
No, the server doesn't throw an exception. The browser simply receives a 404 response for packed.css - I used FileMonitor to see that JBoss looks for these files at the "wrong" place (only in \resources). However, following your tutorial, the files are placed in \WEB-INF\classes\META-INF\resources\. If I copy/move the generated folder to the first location manually, it works as expected.
Btw I found a question on StackOverflow and maybe the OP has the same problem.
-
3. Re: Files built by RichFaces resources plugin not found
michpetrov Jun 25, 2013 7:11 AM (in response to tarnschaf)Hm, okay. Can you show me your web.xml and the contents of the <head> element in the file you get from the server?
-
4. Re: Files built by RichFaces resources plugin not found
tarnschaf Jun 25, 2013 7:18 AM (in response to michpetrov)HTML Output inside <head>:
<script type="text/javascript" src="/ProjectName/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.2.3.Final/Packed/packed/packed.js"></script> <link type="text/css" rel="stylesheet" href="/ProjectName/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.2.3.Final/Packed/myskin/packed/packed.css" />
Probably relevant parts of Web.xml:
<context-param> <param-name>org.richfaces.enableControlSkinning</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>org.richfaces.resourceOptimization.enabled</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>org.richfaces.skin</param-name> <param-value>myskin</param-value> </context-param>
-
5. Re: Files built by RichFaces resources plugin not found
michpetrov Jun 25, 2013 8:29 AM (in response to tarnschaf)You need to enable control skinning.
You have an incomplete skin (because it relies on blueSky) and when you disable control skinning the server cannot find the base values. When you make a full skin you can disable it again.
I am not sure why it behaves this way (i.e. not seeing the files even though they are where they are supposed to be. I'll look into it further and update the blog post.)
-
6. Re: Re: Files built by RichFaces resources plugin not found
sublette131 Feb 26, 2015 6:56 PM (in response to michpetrov)I'm seeing similar sounding issues with a custom skin, also based on BlueSky. I'm running on Tomcat, and I've updated to richfaces 4.5.0.Final. The solution I found elsewhere was to change resourceOptimization to false as shown below.
That got me most of the way there. However, I'm seeing a similar issue on the initial page load that you see when org.richfaces.enableControlSkinning was false (mine was true/not present). Some components get the skin, others like buttons don't. It's only after I use the browser's refresh, the complete styles loaded. I've traced it down to the ECSS file not loading the first time, but I'm not sure why or how to ensure it gets loaded. This happens to me when resourceOptimization is disabled regardless of whether I use blueSky or my custom skin.
<context-param> <param-name>org.richfaces.resourceOptimization.enabled</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>org.richfaces.skin</param-name> <param-value>myskin</param-value> <!-- <param-value>blueSky</param-value> --> </context-param>
First load (no skinning.ecss file loaded):
http://localhost:8080/MyApp/faces/javax.faces.resource/theme.css?ln=css
Second and subsequent loads:
http://localhost:8080/MyApp/org.richfaces.resources/javax.faces.resource/org.richfaces/skinning.ecss?
http://localhost:8080/MyApp/faces/javax.faces.resource/theme.css?ln=css
-
7. Re: Files built by RichFaces resources plugin not found
sublette131 Mar 27, 2015 4:26 PM (in response to sublette131)My problem is probably slightly unrelated. I tracked my problem down to some sort of incompatibilities with prettyfaces (URL rewriting). Removing that library causes everything to load correctly the first time as well as subsequent times. Since I don't want to give up the URL rewriting functionality we have, I found a workaround - add the missing stylesheet manually in each web page:
<h:head>
<link type="text/css" rel="stylesheet" href="#{request.contextPath}/org.richfaces.resources/javax.faces.resource/org.richfaces/skinning.ecss"/>
</h:head>...
The drawback is that after that first load, any subsequent load will request two versions of skinning.ecss, the one above and the one that richfaces normally requests (.../skinning.ecss?db=.....). Since this shouldn't be modified on the server, it should be cached by most browsers.