Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot find "theme.css" resource of "primefaces-" library #7

Open
limsongjing opened this issue Aug 28, 2016 · 1 comment
Open

cannot find "theme.css" resource of "primefaces-" library #7

limsongjing opened this issue Aug 28, 2016 · 1 comment

Comments

@limsongjing
Copy link

limsongjing commented Aug 28, 2016

Hi

I use tomcat 9 on top of jdk1.8, after download the package, I un-comment the mojarra profile section and run "mvn install -P mojarra"

war file is successfully build. However when running, it give me the error shown below.

[Error]
29-Aug-2016 01:13:53.279 SEVERE [http-nio-8080-exec-6] com.sun.faces.application.view.FaceletViewHandlingStrategy.handleRenderException Error Rendering View[/views/chapter11/errors/throwable.xhtml]
javax.faces.FacesException: Error loading css, cannot find "theme.css" resource of "primefaces-" library
at org.primefaces.renderkit.HeadRenderer.encodeCSS(HeadRenderer.java:145)
at org.primefaces.renderkit.HeadRenderer.encodeBegin(HeadRenderer.java:77)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:864)

Firstly it seem like the them 1.0.10 is not available in Maven repo, so I changed to 1.0.8
https://mvnrepository.com/artifact/org.primefaces.extensions/all-themes

But still same error. Any help?

So far the workaround is modify web.xml to hard code the theme name as shown below.

primefaces.THEME

cupertino

Rgds
SJ

@dianmorales
Copy link

To make it run in Tomcat9 you also have to take care of the dependencies as well.

<dependencies>
                <dependency>
                    <groupId>com.sun.faces</groupId>
                    <artifactId>jsf-api</artifactId>
                    <version>${mojarra.version}</version>
                    <scope>provided</scope>
                </dependency>
                <!--
                <dependency>
                    <groupId>com.sun.faces</groupId>
                    <artifactId>jsf-impl</artifactId>
                    <version>${mojarra.version}</version>
                    <scope>provided</scope>
                </dependency>
                -->
            </dependencies>

should looks like

<dependencies>
                <dependency>
                    <groupId>com.sun.faces</groupId>
                    <artifactId>jsf-api</artifactId>
                    <version>${mojarra.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.sun.faces</groupId>
                    <artifactId>jsf-impl</artifactId>
                    <version>${mojarra.version}</version>
                </dependency>
            </dependencies>

and @limsongjing said, the theme must be hardcoded otherwise won't work.

    <context-param>
        <param-name>primefaces.THEME</param-name>
        <param-value>cupertino</param-value>
    </context-param>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants