留言板

publishing jsf application in liferay as portlet

wely cery,修改在6 年前。

publishing jsf application in liferay as portlet

Junior Member 帖子: 38 加入日期: 17-3-6 最近的帖子
hi
i have a completed jsf application.i wana import it to liferay.i read that i can deploy web apllication war files like normal portlets.
i try it but in every war file that i try i get the same error at first.

09:08:31,399 ERROR [fileinstall-/temp/liferay-ce-portal-7.0-ga3/osgi/war][com_liferay_portal_osgi_web_servlet_context_helper:97] JSFDemo_1.0.0 [590] unable to load servlet javax.faces.webapp.FacesServlet
java.lang.ClassCastException: class javax.faces.webapp.FacesServlet

i get in every web app at first an error about FacesServlet

how can i fix this?
thumbnail
Gregory Amerson,修改在6 年前。

RE: publishing jsf application in liferay as portlet

Liferay Legend 帖子: 1123 加入日期: 10-2-16 最近的帖子
Can you share with us a sample project to reproduce this problem? Also can you let us know the version of Liferay portal that you are developing against?
wely cery,修改在6 年前。

RE: publishing jsf application in liferay as portlet

Junior Member 帖子: 38 加入日期: 17-3-6 最近的帖子
i am using liferay version 7

one of the simple project that i try is this -> http://www.mkyong.com/wp-content/uploads/2010/09/JSF2.0-hello-world-example-2.1.7.zip
it gives mostly the same error in every JSF application.

please help
thumbnail
Andy Wu,修改在6 年前。

RE: publishing jsf application in liferay as portlet

Regular Member 帖子: 195 加入日期: 15-5-5 最近的帖子
hey wely , I checked your project . it seems that your project is not a portlet project, and it is a normal jsf project.
so if you want to build some jsf portlet project , you can using liferay-ide to build and here is a sample project for your reference.
wely cery,修改在6 年前。

RE: publishing jsf application in liferay as portlet

Junior Member 帖子: 38 加入日期: 17-3-6 最近的帖子
so an standalone JSF project is not possible to deploy ?
i have a finished JSF project and i have to install it into my liferay server.so do i have to convert it into a liferay JSF project ?
if yes how can i do that ?
thumbnail
Andy Wu,修改在6 年前。

RE: publishing jsf application in liferay as portlet

Regular Member 帖子: 195 加入日期: 15-5-5 最近的帖子
yes , standard jsp project can't be deployed into portal and you should convert it.
For example , if you want display something in UI page , you have xhtml file and in liferay , you should create a portlet and make it in view mode page.
see the following config:
<portlet-name>testJSF</portlet-name>
<display-name>testJSF</display-name>
<portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>
<init-param>
        <name>javax.portlet.faces.defaultViewId.view</name>
        <value>/WEB-INF/views/view.xhtml</value>
</init-param>


we have some tutorials for creating jsf portlet , see here
wely cery,修改在6 年前。

RE: publishing jsf application in liferay as portlet

Junior Member 帖子: 38 加入日期: 17-3-6 最近的帖子
thank u very much Andy.i have a bit experience about liferay portlets and i create jsf liferay portlets before and install it in liferay server.
but in here i read that its possible what i am trying -> https://web.liferay.com/web/guest/community/wiki/-/wiki/Main/Liferay%20Web%20Application%20Integrator

so is it no more possible ?
and some people are talking about liferay portlet bridge portlet. do u know about it?

my misson is to intall my finished JSF project in liferay.so wich way should i use ?
thumbnail
Andy Wu,修改在6 年前。

RE: publishing jsf application in liferay as portlet

Regular Member 帖子: 195 加入日期: 15-5-5 最近的帖子
Sorry , I am in IDE team , and don't know too much about this. But as I see ,the wiki is a little old ( 2010 ) , and now we release liferay 7 and seems there is not such wiki about liferay 7.
wely cery,修改在6 年前。

RE: publishing jsf application in liferay as portlet

Junior Member 帖子: 38 加入日期: 17-3-6 最近的帖子
yeah i think u r right.
i just see the date of that wiki.

so the only one option is to convert my standalone JSF project into JSF liferay portlet right?
thumbnail
Andy Wu,修改在6 年前。

RE: publishing jsf application in liferay as portlet

Regular Member 帖子: 195 加入日期: 15-5-5 最近的帖子
I think so , also it may not take to too much effort , good luck !
wely cery,修改在6 年前。

RE: publishing jsf application in liferay as portlet

Junior Member 帖子: 38 加入日期: 17-3-6 最近的帖子
hey Andy thank u very much for your help.
but i think i cannot fix it by myself.do u have an example for me how to convert and JSF project into liferay project ?
thumbnail
Cody Hoag,修改在6 年前。

RE: publishing jsf application in liferay as portlet

Junior Member 帖子: 70 加入日期: 12-4-26 最近的帖子
Hi Wely,

I gather you're trying to convert a generic JSF portlet to be deployable to Liferay Portal?

Liferay provides Liferay Faces, which is an umbrella project that provides support for the JSF standard within Liferay Portal. You can visit the Liferay Faces reference docs for more info on what it provides. From what I can tell, you'll want to add the Liferay Faces Bridge JAR as a dependency, which is necessary to deploy a JSF portlet to Liferay Portal.

There are also several helpful tutorials for creating a JSF portlet for Liferay Portal: Generating a JSF Application and Creating a JSF Project Manually.

Lastly, the Faces team has many demo portlets you can compare your portlet with: https://github.com/liferay/liferay-faces-bridge-impl/tree/master/demo
wely cery,修改在6 年前。

RE: publishing jsf application in liferay as portlet

Junior Member 帖子: 38 加入日期: 17-3-6 最近的帖子
thank you very much for your reply Cody Hoag

i did exactly what i read in the links.i cread a JSF liferay portlet and install in on my liferay server and it worked fine.
then i add my classes and dependncies to my pom file and i get this error and i realy dont know where is my mistake.
i think i am overwriting a dependency or something like that but i still dont get it.here is my output when i deploy my war file :

08:07:16,813 INFO [fileinstall-/temp/liferay-ce-portal-7.0-ga3/osgi/war][BaseAutoDeployListener:50] Portlets for /temp/liferay-ce-portal-7.0-ga3/tomcat-8.0.32/temp/20170517080715294CKQUKUIZ/com.liferayPortlet.jsf.spring.applicant.portlet-1.0.0.war copied successfully
08:07:33,310 ERROR [Refresh Thread: Equinox Container: 1093be56-d33a-0017-1222-f728c76cd37f][com_liferay_portal_osgi_web_servlet_context_helper:97] com.liferayPortlet.jsf.spring.applicant.portlet-1.0.0_4.1.0 [648] unable to load servlet javax.faces.webapp.FacesServlet
java.lang.ClassCastException: class javax.faces.webapp.FacesServlet
at java.lang.Class.asSubclass(Class.java:3404)
at com.liferay.portal.osgi.web.servlet.context.helper.internal.definition.WebXMLDefinitionLoader._getServletInstance(WebXMLDefinitionLoader.java:889)
at com.liferay.portal.osgi.web.servlet.context.helper.internal.definition.WebXMLDefinitionLoader.endElement(WebXMLDefinitionLoader.java:344)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
..........

i always get that error "unable to load servlet javax.faces.webapp.FacesServlet ".

what do u think it could be the reason ?

so
thumbnail
Andy Wu,修改在6 年前。

RE: publishing jsf application in liferay as portlet

Regular Member 帖子: 195 加入日期: 15-5-5 最近的帖子
Hi Wely , can you share your project with us ?