Forums

angle-left Back

Primefaces CSS loading problem

AG
Alireza Goli, modified 11 Months ago.

Primefaces CSS loading problem

New Member Posts: 10 Join Date: 7/24/17 Recent Posts
Hi,
I want to write a portlet using liferay 6.2+primefaces 6.1. Before adding service builder to project everything is good, but as I add service builder to project and build services , primefaces's CSS files aren't loaded and the portlet appearance is like the picture bellow:






what should I do in order to solve this problem?
Kyle Joseph Stiemann, modified 11 Months ago.

RE: Primefaces CSS loading problem

LIFERAY STAFF Liferay Master Posts: 659 Join Date: 1/14/13 Recent Posts
Hi Alireza,
We haven't yet released a version of Liferay Faces that is tested with PrimeFaces 6.1. However, I am surprised by this CSS problem. Could you see if this error occurs with PrimeFaces 6.0? Also please provide us with the shortest, simplest example code that will reproduce this problem (along with steps to reproduce). Finally, please let us know what versions of Liferay Faces you are using.

Thanks,
- Kyle
AG
Alireza Goli, modified 11 Months ago.

RE: Primefaces CSS loading problem

New Member Posts: 10 Join Date: 7/24/17 Recent Posts
I have tried different versions of Primefaces, but didn't work.
steps to reproduce this problem:
1- Create a Liferay plugin project ( ant build)
2- Add a Liferay JSF portlet
3- Create the above mentioned view file
( after this step view is shown properly)
4- Add a Liferay service builder to project and build something
( after this step view is shown messy and without Primefaces's CSS files)

and finally my Liferay Faces jsf version:

        <dependency name="jboss-el" org="org.jboss.el" rev="2.0.1.GA" />
        <dependency name="jsf-api" org="com.sun.faces" rev="2.1.21" />
        <dependency name="jsf-impl" org="com.sun.faces" rev="2.1.21" />
        <dependency name="liferay-faces-bridge-api" org="com.liferay.faces" rev="3.2.4-ga5" />
        <dependency name="liferay-faces-bridge-impl" org="com.liferay.faces" rev="3.2.4-ga5" />
        <dependency name="liferay-faces-portal" org="com.liferay.faces" rev="3.2.4-ga5" />
        <dependency name="liferay-faces-util" org="com.liferay.faces" rev="3.2.4-ga5" />


Something that is strange for me is that after adding service builder, in tomcat*/webapps/myportlet/WEB-INF/lib
I have two .jar file for primefaces that their names are: primefaces-6.0.jar and org.primefaces.primefaces.jar
but their size is same.

thanks,
Alireza
Kyle Joseph Stiemann, modified 11 Months ago.

RE: Primefaces CSS loading problem

LIFERAY STAFF Liferay Master Posts: 659 Join Date: 1/14/13 Recent Posts
Hi Alireza,
Please upgrade to the latest version of Liferay Faces and Mojarra and retry your test. You can obtain the list of jars and versions that you will need by going to liferayfaces.org and selecting Liferay 6.2 and JSF 2.1 from the dropdowns.

- Kyle
AG
Alireza Goli, modified 11 Months ago.

RE: Primefaces CSS loading problem

New Member Posts: 10 Join Date: 7/24/17 Recent Posts
Hi,
I tried ,but didn't work. The problem is related to duplicate .jar files.When I remove them everything become good again, But I don'nt know how should I prevent these duplicate jar files !

thanks,
Alireza
Kyle Joseph Stiemann, modified 11 Months ago.

RE: Primefaces CSS loading problem

LIFERAY STAFF Liferay Master Posts: 659 Join Date: 1/14/13 Recent Posts
Hi Alireza,
Please list all the dependencies for your portlet and your service jar by posting the full ivy.xml files for both.

- Kyle
AG
Alireza Goli, modified 11 Months ago.

RE: Primefaces CSS loading problem

New Member Posts: 10 Join Date: 7/24/17 Recent Posts
Hi,
I solved my problem by deleting duplicate .jar files in docroot/WEB-INF/lib directory and this is my dependecies:

    <dependencies defaultconf="default">
        <dependency name="jboss-el" org="org.jboss.el" rev="2.0.1.GA" />
        <dependency name="jsf-api" org="com.sun.faces" rev="2.1.21" />
        <dependency name="jsf-impl" org="com.sun.faces" rev="2.1.21" />
        <dependency name="liferay-faces-bridge-api" org="com.liferay.faces" rev="3.2.4-ga5" />
        <dependency name="liferay-faces-bridge-impl" org="com.liferay.faces" rev="3.2.4-ga5" />
        <dependency name="liferay-faces-portal" org="com.liferay.faces" rev="3.2.4-ga5" />
        <dependency name="liferay-faces-util" org="com.liferay.faces" rev="3.2.4-ga5" />
       
        <dependency org="org.primefaces" name="primefaces" rev="6.0"/>
       
        <dependency conf="test->default" name="arquillian-junit-container" org="org.jboss.arquillian.junit" rev="1.1.6.Final" />
        <dependency conf="test->default" name="arquillian-tomcat-remote-7" org="org.jboss.arquillian.container" rev="1.0.0.CR6" />
        <dependency conf="test->default" name="com.liferay.ant.arquillian" org="com.liferay" rev="1.0.0-SNAPSHOT" />
    </dependencies>

thanks,
Alireza
Kyle Joseph Stiemann, modified 11 Months ago.

RE: Primefaces CSS loading problem

LIFERAY STAFF Liferay Master Posts: 659 Join Date: 1/14/13 Recent Posts
Hi Alireza, glad to hear that you fixed the issue! I highly recommend that you update your jars to the latest versions in order to get important security and bug fixes. Thanks for using Liferay Faces!

- Kyle