Error loading theme, cannot find "font-awesome.css" resource

UI Components for JSF
pitupitu
Posts: 34
Joined: 22 Nov 2011, 23:22

22 Oct 2014, 08:38

Hello, tried to use 5.1.1 font-awesome feature. I've set in my app primefaces.FONT_AWESOME context param to true and got exception:

Code: Select all

Error loading theme, cannot find "font-awesome.css" resource of "primefaces/fa" library

viewId=/auth/login.xhtml
location=[path]\auth\login.xhtml
phaseId=RENDER_RESPONSE(6)

Caused by:
javax.faces.FacesException - Error loading theme, cannot find "font-awesome.css" resource of "primefaces/fa" library
at org.primefaces.renderkit.HeadRenderer.encodeCSS(HeadRenderer.java:138)
Is there anything else that should be done to get font-awesome feature working?
thanks

Tomcat 7.0.56, MyFaces 2.2.5, PrimeFaces 5.1.1

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

22 Oct 2014, 16:11

Showcase is working and just checked, the file is there. Not sure what the problem is right now. What happens when you add;

<h:outputStylesheet library="primefaces" name="fa/font-awesome.css" />

pitupitu
Posts: 34
Joined: 22 Nov 2011, 23:22

22 Oct 2014, 19:50

Adding outputSheet hasn't changed anything. Still the same problem.

pitupitu
Posts: 34
Joined: 22 Nov 2011, 23:22

22 Oct 2014, 22:01

OK. I have debug a little bit and found the solution. This is a MyFaces issue. It doesn't allow slashes in library names ("primefaces/fa").
There's a parameter org.apache.myfaces.STRICT_JSF_2_ALLOW_SLASH_LIBRARY_NAME where this behaviour can be changed. Default value is false.
Change the parameter to true and have fun with PF font-awesome feature working. :)

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

23 Oct 2014, 11:11

Thanks for sharing the solution.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

23 Oct 2014, 23:15

Fixed for 5.1.2, it should work without this setting as well.

pitupitu
Posts: 34
Joined: 22 Nov 2011, 23:22

23 Oct 2014, 23:51

Great. Thanks.

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

24 Oct 2014, 09:54

Just to clarify this:

Thats a correct behavior and specified in the JSF API. Therfore it's NOT a MyFaces bug.
Mojarra just allows both.
As already mentioned, in MyFaces you can also allow slashes in the library via: org.apache.myfaces.STRICT_JSF_2_ALLOW_SLASH_LIBRARY_NAME
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

24 Oct 2014, 11:52

and what is the advantage of including font-awesome instead of just creating a maven dependency on it?

http://mvnrepository.com/artifact/org.w ... some/4.2.0

includes a jsf ready version with correct src url's etc..... No need to redo this...

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

24 Oct 2014, 12:10

I think it's promotion 8-)
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 31 guests