Foros de discusión
JSF Portlets Common Lib Loading
Aliasgar Kapadiya, modificado hace 6 años.
JSF Portlets Common Lib Loading
New Member Mensajes: 16 Fecha de incorporación: 31/10/16 Mensajes recientes
Greetings,
I am developing multiple JSF Portlets in DXP using Liferay IDE. Server used is Jboss/Wildfly.
Previously in 6.2, we used to have a single project containing all the JSF portlets, hence one WAR file contained all the dependencies and the portlets.
Now, I have few questions as below :-
1) What is the best way to create multiple JSF portlets for same site?
a)A single JSF Project containing all the portlets or
b)Different JSF projects for each portlet.
2) If "a" is the answer, then how can we use exploded WAR concept as it was in 6.2, to ease development process?
3) If "b" is the answer, then how can we load dependencies such as faces-api, liferay-faces-bridge libs from a common classloader?, is there any way to put these libs in common osgi modules and inject their dependency in each JSF projects, like how it's done for liferay-portal-kernel lib?
The above method will reduce the WAR size of each portlet to a great extent.
Appreciate your kind feedback in this matter.
I am developing multiple JSF Portlets in DXP using Liferay IDE. Server used is Jboss/Wildfly.
Previously in 6.2, we used to have a single project containing all the JSF portlets, hence one WAR file contained all the dependencies and the portlets.
Now, I have few questions as below :-
1) What is the best way to create multiple JSF portlets for same site?
a)A single JSF Project containing all the portlets or
b)Different JSF projects for each portlet.
2) If "a" is the answer, then how can we use exploded WAR concept as it was in 6.2, to ease development process?
3) If "b" is the answer, then how can we load dependencies such as faces-api, liferay-faces-bridge libs from a common classloader?, is there any way to put these libs in common osgi modules and inject their dependency in each JSF projects, like how it's done for liferay-portal-kernel lib?
The above method will reduce the WAR size of each portlet to a great extent.
Appreciate your kind feedback in this matter.
Fakhruddin S Mushki, modificado hace 6 años.
RE: JSF Portlets Common Lib Loading
Junior Member Mensajes: 78 Fecha de incorporación: 10/04/13 Mensajes recientes
Check https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/liferay-portal-classloader-hierarchy
Kyle Joseph Stiemann, modificado hace 6 años.
RE: JSF Portlets Common Lib Loading (Respuesta)
Liferay Master Mensajes: 760 Fecha de incorporación: 14/01/13 Mensajes recientes
Hi Aliasgar,
Either way is fine, but I would recommend "a)A single JSF Project containing all the portlets" since you'll have less duplicate config and dependency jars that way.
Unfortunately, right now exploded WARs cannot be used with Liferay 7.0. Liferay 7.0 uses OSGi to handle WARs now which means app server conveniences and features are not available for WARs deployed to Liferay. See this StackOverflow Q&A for more details: https://stackoverflow.com/questions/40826689/where-is-war-exploded-in-liferay-7-tomcat-after-getting-copied-in-osgi-folder/40829385
However, the Liferay IDE team is working on a feature that would work similarly to exploded wars: https://issues.liferay.com/browse/IDE-3743 (vote for the issue if you are interested).
Great question! We're currently working on making the Liferay Faces jars into OSGi modules that can be deployed in $LIFERAY_HOME/osgi/modules. That way, they no longer need to be contained in each WAR. We have many of our demo portlets deployed without any dependencies included in WEB-INF/lib. Once we've gotten all the demos working as thin WARs, we'll try to release some release candidates so you can test them out. You can watch this issue for more details: https://issues.liferay.com/browse/FACES-3024.
- Kyle
1) What is the best way to create multiple JSF portlets for same site?
a)A single JSF Project containing all the portlets or
b)Different JSF projects for each portlet.
Either way is fine, but I would recommend "a)A single JSF Project containing all the portlets" since you'll have less duplicate config and dependency jars that way.
2) If "a" is the answer, then how can we use exploded WAR concept as it was in 6.2, to ease development process?
Unfortunately, right now exploded WARs cannot be used with Liferay 7.0. Liferay 7.0 uses OSGi to handle WARs now which means app server conveniences and features are not available for WARs deployed to Liferay. See this StackOverflow Q&A for more details: https://stackoverflow.com/questions/40826689/where-is-war-exploded-in-liferay-7-tomcat-after-getting-copied-in-osgi-folder/40829385
However, the Liferay IDE team is working on a feature that would work similarly to exploded wars: https://issues.liferay.com/browse/IDE-3743 (vote for the issue if you are interested).
3) If "b" is the answer, then how can we load dependencies such as faces-api, liferay-faces-bridge libs from a common classloader?, is there any way to put these libs in common osgi modules and inject their dependency in each JSF projects, like how it's done for liferay-portal-kernel lib?
The above method will reduce the WAR size of each portlet to a great extent.
Great question! We're currently working on making the Liferay Faces jars into OSGi modules that can be deployed in $LIFERAY_HOME/osgi/modules. That way, they no longer need to be contained in each WAR. We have many of our demo portlets deployed without any dependencies included in WEB-INF/lib. Once we've gotten all the demos working as thin WARs, we'll try to release some release candidates so you can test them out. You can watch this issue for more details: https://issues.liferay.com/browse/FACES-3024.
- Kyle
Aliasgar Kapadiya, modificado hace 6 años.
RE: JSF Portlets Common Lib Loading
New Member Mensajes: 16 Fecha de incorporación: 31/10/16 Mensajes recientes
Thank you very much Kyle for your response.
Juan Gonzalez, modificado hace 6 años.
RE: JSF Portlets Common Lib Loading
Liferay Legend Mensajes: 3089 Fecha de incorporación: 28/10/08 Mensajes recientesKyle Joseph Stiemann:
Great question! We're currently working on making the Liferay Faces jars into OSGi modules that can be deployed in $LIFERAY_HOME/osgi/modules. That way, they no longer need to be contained in each WAR. We have many of our demo portlets deployed without any dependencies included in WEB-INF/lib. Once we've gotten all the demos working as thin WARs, we'll try to release some release candidates so you can test them out. You can watch this issue for more details: https://issues.liferay.com/browse/FACES-3024.
- Kyle
These are great news! Thanks Kyle!
Aliasgar Kapadiya, modificado hace 6 años.
RE: JSF Portlets Common Lib Loading
New Member Mensajes: 16 Fecha de incorporación: 31/10/16 Mensajes recientes
Dear Kyle,
When can we expect the OSGi Libs for liferay-faces to be provided?.
I tried converting the existing JARs of JSF using eclipse plug-in tools which exports to OSGi bundle. But, the invocation of jsf library gives me below errors.
NoClassDefFoundError: javax/servlet/Servlet
Appreciate your feedback for the same.
When can we expect the OSGi Libs for liferay-faces to be provided?.
I tried converting the existing JARs of JSF using eclipse plug-in tools which exports to OSGi bundle. But, the invocation of jsf library gives me below errors.
NoClassDefFoundError: javax/servlet/Servlet
Appreciate your feedback for the same.
Kyle Joseph Stiemann, modificado hace 6 años.
RE: JSF Portlets Common Lib Loading
Liferay Master Mensajes: 760 Fecha de incorporación: 14/01/13 Mensajes recientes
Hi Aliasgar,
Unfortunately, a few more pressing issues have come up and I've been unable to work on this. If you want to try out my branches right now, you can follow my instructions here: https://issues.liferay.com/browse/FACES-3024?focusedCommentId=1271454&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-1271454. I'm trying to get back to working on the OSGi stuff, but I don't know when I will be able to.
- Kyle
Unfortunately, a few more pressing issues have come up and I've been unable to work on this. If you want to try out my branches right now, you can follow my instructions here: https://issues.liferay.com/browse/FACES-3024?focusedCommentId=1271454&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-1271454. I'm trying to get back to working on the OSGi stuff, but I don't know when I will be able to.
- Kyle