Error loading theme, cannot find "theme.css" resource of "primefaces-start" library
Asked Answered
J

3

6

When I run my project on Tomcat server, it shows this error:

Error loading theme, cannot find "theme.css" resource of "primefaces-start" library

Here's the stack trace:

javax.servlet.ServletException: Error loading theme, cannot find "theme.css" resource of "primefaces-start" library
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:321)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)


root cause 

javax.faces.FacesException: Error loading theme, cannot find "theme.css" resource of "primefaces-start" library
    org.primefaces.renderkit.HeadRenderer.encodeTheme(HeadRenderer.java:130)
    org.primefaces.renderkit.HeadRenderer.encodeBegin(HeadRenderer.java:92)
    javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:824)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1641)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1646)
    com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:389)
    com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:127)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:117)
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:309)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)

How is this caused and how can I solve it?

Johiah answered 19/1, 2015 at 7:55 Comment(2)
Is there 'theme.css' file on the server?Peraza
no there is not any theme.css file on the server,Johiah
D
4

This just means that the primefaces-start theme isn't being installed in the webapp.

As per the PrimeFaces themes homepage, you need to install it via either an additional Maven pom.xml entry, or if you're not using Maven, by manually downloading the theme JAR file from PrimeFaces repository in Maven.

The PrimeFaces start theme is available here, the currently latest version is 1.0.10. So just grab the JAR over there, the start-1.0.10.jar and drop it in /WEB-INF/lib folder the usual way.

Delly answered 19/1, 2015 at 9:13 Comment(1)
Thanks DMity and BalusC, my problem is resolved, actually start theme is not being installed, i just download it now its runing........Thanks again for your valuable suggestionsJohiah
C
0

Install the last version resolved problem for me. primefaces 6.1

  • if you use maven, include in the pom.xml:

    <dependency>
        <groupId>org.primefaces</groupId>
        <artifactId>primefaces</artifactId>
        <version>6.1</version>
    </dependency>
    
  • if not use maven download primefaces 6.1 library and paste in the folder WebContent/WEB-INF/lib

Canvas answered 24/8, 2017 at 14:24 Comment(1)
Your answer is about installing PrimeFaces itself, not a specific theme. If PrimeFaces itself is not installed. You can never get the error in the questionVraisemblance
S
0

add repository in pom.xml for mi work fine

<repositories>
        <repository>
            <id>primefaces</id>
            <name>PrimeFaces Maven Repository</name>
            <layout>default</layout>
            <url>http://repository.primefaces.org</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
Skiff answered 30/4 at 17:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.