6
votes

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?

2
Is there 'theme.css' file on the server?DmitryKanunnikoff
no there is not any theme.css file on the server,TayyebaRehman

2 Answers

4
votes

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.

0
votes

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