Fórum

Working Richfaces portlet available

thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi,

I uploaded a Richfaces portlet that works for me to the Liferay community plugin page.
It works with Glassfish and Tomcat as well.

I hope others will like the solution and in the future we will always have working Richfaces portlets for each version of Liferay.

You can find the plugin here.

Regards,
Balazs
thumbnail
Laurens van der Blom, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 11 Data de Entrada: 06/08/10 Postagens Recentes
Thanks, this might be what I need for deploying JSF portlets containig RichFaces. I'm having a lot of difficulties in getting it to work, especially when ADF comes into play.

However, upon clicking the download link, I'm prompted for a username and password in order to log into the Maven repository. Instead, this link (last line of the page has the correct download link) might be better until the repository is clear of access restrictions.

I'll let you know how it goes with the portlet on my Tomcat server.
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi,

due to some reason the security settings on the web site were changed. The download link should work now well.

Also it is possible now to install the plugin at "control panel/Plugin Installation" page in an own Liferay instance.

Please let me know if something does not work as it would be nice to find it out before going live with any project. Thanks!

Regards,
Balazs
thumbnail
Henrique Simoes de Andrade, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Regular Member Postagens: 165 Data de Entrada: 30/04/10 Postagens Recentes
Hi!
It's a great example and works fine in LR 5.2.3, I was looking for something like this a long time ago.
Thanks!

sorry my English... ehe
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi,

I am happy to hear that it works also in 5.2.3. In that version I must mention the followings:

You might have realized that the menu of Liferay does not work well. This is because the version of jquery in Liferay 5.2.3 is not compatible fully with the version of Richfaces jquery.

To fix it:
- Go into richfaces-impl.jar
- Find the file jquery.js
- Delete the content of jquery.js

With this Richfaces only downloads an empty jquery.js file so the on comes with Liferay will be the stronger. There are some components in Richfaces that have problems with the Liferay jquery version. For exampl the rich:calendar component works but you cannot set the hour and minutes in it.

Regards,
Balazs
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi,

I have just uploaded a new version of the war that contains a new richfaces-impl.jar
The difference is that I copied to the end of prototype.js the patch available at the issue tracker of prototype . This fixes the issue that poller servlet is throwing exceptions when prototype.js is loaded (richfaces portlet is on the page)
The issue is also noted in this post.
thumbnail
Laurens van der Blom, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 11 Data de Entrada: 06/08/10 Postagens Recentes
I can confirm it works on Liferay 6.0.4 CE on Tomcat 6.0.29. However, due to my Tomcat configuration, I had trouble loading your portlet. I have different kinds of libraries installed in the tomcat/lib folder, which apparently conflicted with yours in the portlet. Removing the conflicting libraries solved it.

Moreover, deployment goes without problems, but when adding the portlet to the portal in the same session, I get the following exception and the portlet fails to load:


ERROR [SerializableSessionAttributeListener:39] com.liferay.samplesffacelets.bean.UserBean is not serializable and will prevent this session frombeing replicated
ERROR [InsertTag:922] ServletException in '/html/common/themes/porlet.jsp': File "/pages/view.jsf" not found
javax.servlet.ServletException: File "/pages/view.jsf" not found
        at org.apache.jasper.servlet.JspServlet.handleMissingResource(JspServle.java:335)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:01)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(AppicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationilterChain.java:206)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisatcher.java:646)
        at org.apache.catalina.core.ApplicationDispatcher.doInclude(Applicationispatcher.java:551)
        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDipatcher.java:488)
        at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrar.java:968)
        at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.jaa:621)
        at com.liferay.portal.kernel.servlet.PageContextWrapper.include(PageConextWrapper.java:147)
        at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:9)
        at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:135)
        at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:76)
        at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsetTag.java:892)
        at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
        at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render005fportlet_jsp.java:1848)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrappe.java:377)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:13)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(AppicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationilterChain.java:206)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisatcher.java:646)
        at org.apache.catalina.core.ApplicationDispatcher.doInclude(Applicationispatcher.java:551)
        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDipatcher.java:488)
        at com.liferay.portal.util.PortalImpl.renderPortlet(PortalImpl.java:364)
        at com.liferay.portal.util.PortalImpl.renderPortlet(PortalImpl.java:360)
        at com.liferay.portal.util.PortalUtil.renderPortlet(PortalUtil.java:115)
        at com.liferay.portal.action.RenderPortletAction.execute(RenderPortletAtion.java:85)
        at com.liferay.portal.action.UpdateLayoutAction.addPortlet(UpdateLayoutAction.java:260)
        at com.liferay.portal.action.UpdateLayoutAction.execute(UpdateLayoutAction.java:211)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
        at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:152)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:502)
        at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:479)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
        at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:259)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
        at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:126)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
        at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:204)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
        at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:81)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
        at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:179)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
        at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:241)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
        at com.liferay.portal.servlet.filters.threadlocal.ThreadLocalFilter.processFilter(ThreadLocalFilter.java:35)
        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Unknown Source)


Restarting the Tomcat server fixes it and the portlet loads fine. I'll use your work to find out whether ADF can be used as well, as that's what I'm having lots of trouble with (see my thread, if you want).
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi,

I do not know about library conflicts as for tests I use clean Liferay. A played a lot around having Richfaces and it's dependencies in the classpath of the Application server. It worked but as my main target is Glassfish V3 the classloading mechanism is much more complicated there due to the possibility of modularization.

the first error about Serialization can be solved if the UserBean implements Serializable. It is only necessary if the managed bean is in session scope. However the portlet works with this error as well. I will upload a modified version that will have a Serializable UserBean.

The second error only happens when somebody places out the portlet onto the screen. There is no need to restart the server only to refresh the page. It seems that the AJAX based portlet insert of Liferay does not like this portlet. An <ajaxable>false</ajaxable> in liferay-portlet.xml can help on this however for me it was more confortable to press an F5 in the browser after placing the portlet out emoticon. In the future if I have some time I might check why this happens.

Regards,
Balazs
thumbnail
Laurens van der Blom, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 11 Data de Entrada: 06/08/10 Postagens Recentes
Thanks for your reply.

I figured you'd use a clean version of Tomcat and Liferay for testing purposes. Upon discovering that conflict, I simply deleted the libraries temporarily, effectively reverting the server back to default and it worked. You'll probably know how cumbersome it can be to find out which libraries are supposed to be used for an application and which are not. I had it too when working with ADF 11g on Tomcat. emoticon

It's good to know that a server restart is not necessary to fix that last error. Thanks for the tip. emoticon

You did a nice job with this sample application.
Sergej Logis, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 4 Data de Entrada: 09/06/10 Postagens Recentes
I totally agree! Huge THANKS for your work, Balazs! emoticon

Look, maybe you can check my post and see if you can help me on this one? Right now I'm doing research for a new long-term project, and I must choose which technology to incorporate for our portlets - Wicket or JSF (RichFaces or ICEFaces). Also, maybe you have a word on the choice between RichFaces and ICEFaces?
I would be very grateful for any of your help! Thanks in advance.
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi,

sorry, I forgot about the question about RichFaces and ICEFaces.

I did not use ICEFaces much. My colleagues used it for a project because there were an ICEFaces portlet available at that time. However just before the end of the project they switched everything to RichFaces due to a bug they could not solve faster than converting to the other technology. The bug was that if multiple users visited the same page the ajax requests seemed to be randomly use the other user's session. It was pretty strange emoticon The conclusion was that it is not impossible to do the switch on the end of a project as the components are almost the same. And luckily we used the MVC patter that is described at http://blog.icefaces.org/blojsom/blog/default/2009/04/23/Making-distinctions-between-different-kinds-of-JSF-managed-beans/ so biggest part of the code remained jsf implementation independent.

I guess that bug has been solved since. We discussed it at that time and we got the impression that ICEFaces hides the AJAX calls a bit more from the developer. There were many AJAX calls and without looking into the javascript of the component we did not know why and when. This is not a bad behavior but we felt that we could not have control over the happenings.

For me at least RichFaces components seem to be a bit more logical, they do what I expect and they send AJAX calls when I expect. Also the a4j:support tag that came with Ajax4Jsf seems to become now a basic tag in JSF2. It is called differently however it is the same.

As I do not have much experience with ICEFaces I think it is important to ask somebody who has. What I can say is that both of them are buggy but if somebody does not afraid to look into the source code it is not such a big problem. The most important question is which one will have better support in the future. I do not know about ICEFaces but RichFaces seems to have a pretty big community or at least the source in SVN changes rapidly.


Regards,
Balazs
Angelo Immediata, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 34 Data de Entrada: 08/02/10 Postagens Recentes
Hi Balazs

I'm using this environment:

  • Richfaces 3.3.3 final
  • Spring 3.0.4 for bean definition
  • Liferay 5.2.3


Well when i deploy a portlet built by richfaces and portlet bridge 1.0 i saw that Liferay javascripts no more work (the menu is not working, the drag and drop is no more working and so on) when i change page and i go in a page where no richfaces portlet is present all works pretty good
I think it's a JQuery conflicts problem but how may i solve it? In liferay 6 all works pretty good (both richfaces portlet and the liferay javascripts) i tried your sample too but in liferay 5.2.3 i have the described error....Do you have any ideas?

Regards,
Angelo
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi Angelo,

in Liferay 5.2.3 a different version of JQuery is used as in Richfaces. The only solution is if you use only the one that Liferay uses.

To do that you must go into Richfaces-impl.jar, find the jquery.js file and delete the content of it.

With this solution only the Liferay Jquery is downloaded and most of the Richfaces components will work with that version. Some of them will have problems as they need newer JQuery. For example the rich:calendar component works but you cannot set the hour and minutes in the popup window.

In Liferay 6.x this is not a problem anymore as Liferay does not use JQuery in this version.

Regards,
Balazs
Ayorinde Afolayan, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 5 Data de Entrada: 16/06/10 Postagens Recentes
Hello Balazs Zsoldos ,

If there is anything making me switch over to using richfaces in liferay, then it's you! I had gave up until i tried your example(it worked fine---i even used it with spring 3,JPA). Now after investing time and trust into it, i suddenly came to this showstopper! The problem is that whenever i add two or more portlets having menu on a page, only the first one is enabled, the rest just feel disabled kind of.

Please kindly help on this.

Once again am using this medium to say a very big thank you for making it possible to use richfaces in liferay 6.05
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi,

I am happy that others are using the same solution as we do. That means for me that it will live a long time (I mean Richfaces and Liferay combo).

For this problem I would have only a couple of idea at the moment as I am very busy (working on weekends as well...):
  • Maybe adding rich:page to wrap the portlet helps. Some of the components does not work if the portlet response does not contain html, head and body elements. Not a nice solution but browsers can handle it.
  • Using f:subview with unique id. Everything that is under a subview will get an id like subviewId:xxx. With that you can be sure that the ids in the page are unique and they do not hit the other portlet.
  • Reconstructing the menu and portlets: Having two different liferay subpage for each portlet. I know this is not the nices solution for you. However we designed our pages always to have only one function portlet on it with Richfaces technology. This was because portlets cannot access each others session attributes anyway.
  • Using a page and put two iframe portlets within it, that point to your richfaces portlets (that are placed on hidden pages). Also not the nicest but in this case I am pretty sure both portlets will work on the same page.


I am sorry if non of this fits to your needs. I can try something not before the end of next week as we have a project deadline at that time.

Regards,
Balazs
Ayorinde Afolayan, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 5 Data de Entrada: 16/06/10 Postagens Recentes
Wow! that was a very quick response, honestly i feel very honoured.
Thanks i will try those and report as soon as possible. Thank you very much
Ayorinde Afolayan, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 5 Data de Entrada: 16/06/10 Postagens Recentes
Thanks Balazs. I tried the options given but the iframe solution seems to be the only one that worked.
It loaded the whole page into the page(not really what i want).

I stumble upon a solution that seems to fit but i just don't know how to fix the menu.js script

Here is the link https://jira.jboss.org/browse/RF-8174


Thanks for taking time out to help


Ayo
Ayorinde Afolayan, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 5 Data de Entrada: 16/06/10 Postagens Recentes
Okay i was able to locate where the menu.js file is after seeing resources-config.xml (org/richfaces/renderkit/html/scripts/menu.js). I made couple of changes to that file but to no avail, so i tested if that script is even used at all. So i deleted the content in the file and deployed the portlet again. But to my surprise, the portlet keep working as if nothing was deleted! Was i working on the wrong file as specified here https://jira.jboss.org/browse/RF-8174?


Ayo
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi,

are you sure the browser downloaded the correct js file? I normally check with firebug what js files are present. In the url it is shown normally in which package the js file is placed. And often turns out that the browser caches the js files, images and css files. Ctrl+F5 normally helps in this situation emoticon

Also when richfaces is in a portlet and the cache filter of liferay is turned on it can make troubles. As much as I remember liferay cache filter is mapped to *.js. I sugges to delete it from the web.xml of your portlet.

Regards,
Balazs
Ayorinde Afolayan, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 5 Data de Entrada: 16/06/10 Postagens Recentes
Hello Balazs,

Finally i was able to get it working. Before i proceed i would love to use this medium to thank you again.

Alright, for anyone who got stuck due to this kind of problem, here is what i discovered. Its rather unfortunate that the menu.js file i found didn't seem to have any effect. I discovered with firebug that it was never used instead there was this call to ui.pack.js.(org/ricfaces/ui.pack.js) This file contains all that could be found in menu.js file and other files too. So i located where Rich.Menu.Layers declaration was done and i checked whether it already exists and avoid reinitializing it again:

...if(RichFaces.Menu.Layers==null || RichFaces.Menu.Layers==undefined)
RichFaces.Menu.Layers={listl:new Array(),f
...


The above shows a section of the code.

NOTE:You would have to clear your cache should the script was cached. Maybe you would need to delete the filter Balazs suggested and also enter the following in your portal-ext.properties to be able to edit directly javascript files and for development purpose:

theme.css.fast.load=false
theme.images.fast.load=false
javascript.fast.load=false
javascript.log.enabled=true
layout.template.cache.enabled=false
last.modified.check=false
velocity.engine.resource.manager.cache.enabled=false
com.liferay.portal.servlet.filters.cache.CacheFilter=false
com.liferay.portal.servlet.filters.layoutcache.LayoutCacheFilter=false




Thank you Balazs and others that are making RichFaces(especially the RichFaces guys) usable


Ayo
Mahesh Ghule, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Mensagem: 1 Data de Entrada: 21/11/10 Postagens Recentes
Hi Balazs,
First of all let me take this apportunity to thanks you whole heartedly. If it were not for your post I had all but given up about JSF+RichFaces+Portlets on Liferay. You are my saviour.

Using your example I managed to get all I wanted to do.
But... I wished I could do some more.
I am using maven so would like to know if your jar or patched ones are available anywhere. Can you please suggest a POM.
I am also willing to use the most stable and up-to date versions of the dependencies. So please suggest what I could use.
I know I may be asking too much so please forgive me but I know you will never get Knowledge if you don't ask.

Thanks in advance.

I owe you a lot.

Thanks,
Mahesh
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi,

again I am happy that somebody find the example useful. It is not my achievement that it works as Jboss guys implemented the portlet bridge emoticon.

We also use maven. We have a public repository at http://maven2.everit.biz/repository/public/. That should contain every custom dependencies.

The portletbridge jar does not have to be patched anymore as 2.0.1.CR1 already contains my changes and it seems that it works in liferay well.

The Richfaces implementation contains only one change inside. The jquery js file is appended with a bugfix so the liferay built in chat portlet does not thow exceptions in every couple of seconds due to jquery-json incompatibility. The core functionality would work anyway.

I think at the moment we do not have working archetype but I think we will create one (when we have some time) and I will post it here somewhen.

Here is a snippet from one of our pom.xml that contains every dependency (I hope):

		<dependency>
			<groupid>javax.faces</groupid>
			<artifactid>jsf-impl</artifactid>
			<version>1.2_13</version>
			<type>jar</type>
			<optional>false</optional>
		</dependency>
		<dependency>
			<groupid>javax.faces</groupid>
			<artifactid>jsf-api</artifactid>
			<version>1.2_13</version>
			<type>jar</type>
			<optional>false</optional>
		</dependency>
		<dependency>
			<groupid>com.sun.facelets</groupid>
			<artifactid>jsf-facelets</artifactid>
			<version>1.1.15.B1</version>
			<type>jar</type>
			<optional>false</optional>
		</dependency>
		<dependency>
			<groupid>javax.el</groupid>
			<artifactid>el-api</artifactid>
			<version>1.2</version>
			<type>jar</type>
			<scope>provided</scope>
			<optional>false</optional>
		</dependency>
		<dependency>
			<groupid>javax.portlet</groupid>
			<artifactid>portlet-api</artifactid>
			<version>2.0</version>
			<type>jar</type>
			<scope>provided</scope>
			<optional>false</optional>
		</dependency>
		<dependency>
			<groupid>com.liferay.portal</groupid>
			<artifactid>portal-service</artifactid>
			<version>${liferay.version}</version>
			<type>jar</type>
			<scope>provided</scope>
			<optional>false</optional>
		</dependency>
		<dependency>
			<groupid>org.richfaces.ui</groupid>
			<artifactid>richfaces-ui</artifactid>
			<version>${richfaces.version}</version>
			<type>jar</type>
			<optional>false</optional>
		</dependency>
		<dependency>
			<groupid>org.richfaces.framework</groupid>
			<artifactid>richfaces-impl</artifactid>
			<version>${richfaces.impl.version}</version>
			<type>jar</type>
			<optional>false</optional>
		</dependency>
		<dependency>
			<groupid>org.jboss.portletbridge</groupid>
			<artifactid>portletbridge-impl</artifactid>
			<version>${jboss.portletbridge.impl.version}</version>
			<type>jar</type>
			<optional>false</optional>
		</dependency>
		<dependency>
			<groupid>org.jboss.portletbridge</groupid>
			<artifactid>portletbridge-api</artifactid>
			<version>${jboss.portletbridge.api.version}</version>
			<type>jar</type>
			<optional>false</optional>
		</dependency>
		<dependency>
			<groupid>javax.servlet</groupid>
			<artifactid>servlet-api</artifactid>
			<version>2.5</version>
			<type>jar</type>
			<scope>provided</scope>
		</dependency>



Regards,
Balazs
Erich Semmel, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 7 Data de Entrada: 12/11/10 Postagens Recentes
thanks for this example! works really great and your advise to get it working in liferay 5.2.3 without menu-problems helped me a lot!

I used your exampe to build up an own portlet. The AJAX Retype thing you showd in your example works pretty well. But I have a problem with rendering a panel. Here is a part of my code:

<rich:panel id="panel" style="width:245px;">
						
				<p><h:outputtext value="Input: " /></p>
				<p><h:inputtext id="input" value="#{test.name}">
					<a4j:support event="onkeyup" reRender="outputName" />
				</h:inputtext></p>
				<p><h:commandbutton action="#{test.findFirstName}" value="find first name">
					<a4j:support event="onclick" reRender="panel" />
				</h:commandbutton></p>
				<h:outputtext value=" AJAX Retype: " />
				<h:outputtext id="outputName" value="#{test.name}" />

				<rich:datalist var="result" value="#{test.nameList}" rows="10">
					<h:outputtext value="#{result.name}" />
					<br>
					<h:outputtext value=" #{result.firstName}" />
				</rich:datalist>
</rich:panel>


the AJAX Retype-thing works, but when I submit the button: the hole page is new loaded instead of just a "reRender" of my panel.

Maybe it's a very simple question, but I'm new in working with AJAX...
Thanks
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi,

h:commandbutton almost always submits the whole page. There are a few exceptions:
- the form is a4j:form and not h:form. a4j:form catches all submit requests and translates it to ajax.
- There is a "return false" in the onclick event of the commandbutton

In your case ajax call is done due to a4j:support but than the normal submit is also done because of h:commandbutton.

I think you should use a4j:commandButton. It is ajax based and has all of the properties as a4j:support (for example reRender). You do not need to use a4j:support with it.

Regards,
Balazs
Albert Torre, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Mensagem: 1 Data de Entrada: 13/12/10 Postagens Recentes
It seems that the download link is returning a 0 length war file. Is there a new link?

Thanks,
Al
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi,

it seems that the file simply became 0 byte long on our server. I do not know why. Anyway I created a new version that contains the new PortletBridge (not custom one) as it contains the Liferay compatibility patch and for me it seemed to work well. If you experience any problem please let me know and I will upload the old version of portletbridge with our patch.

I hope the next version of this sample will be the one that contains the jsf 2.0 and Richfaces 4 jars.

Regards,
Balazs
ly tm, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 13 Data de Entrada: 13/12/10 Postagens Recentes
- I'm a student come from VietNam!
- I'm studying about Richface framework!
- I had got a problem in JSF(Richface) Portlet when I used JavaScript!
That problem is : I could not get a value into a <h:inputText /> with JavaScript!
Can Everybody help me?
Thanks so much!
This is my code:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
<f:view>
<script type="text/javascript">
function check() {
var result = document.getElementById("myform:form").value;
alert(result);
}
</script>
<h:form id="myform">
<h3>Hello :</h3>
<h:inputText value="" id="form" />
<h:commandButton value="OK" onclick="check();"/>
</h:form>
</f:view>
</ui:composition>
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi,

I think this issue is more related to Richfaces than to Liferay portal.

When you use id attribute in a jsf element you cannot be sure that the id will be given on the client side in the rendered html. You should use #{rich:element(id)} and it will be converted to the right javascript function call browser independently and using the client generated id.

For more information please see chapter 5.6.6 of the this document.

Regards,
Balazs
ly tm, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 13 Data de Entrada: 13/12/10 Postagens Recentes
- Thanks Balazs Zsoldos!
- Please! Can you provide details of the code?
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Did you check the link in my last post? There are examples in that chapter.
ly tm, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 13 Data de Entrada: 13/12/10 Postagens Recentes
- Hi Balazs Zsoldos!
- I had to try it but still error code.
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
I meant the following:

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich">
<script type="text/javascript">
function check() {
var result = #{rich:element('form')}.value;
alert(result);
}
</script>
<h:form id="myform">
<h3>Hello :</h3>
<h:inputText value="" id="form" />
<h:commandButton value="OK" onclick="check();"/>
</h:form>
</ui:composition>

Does it work?
Please note thefollowing changes:
- xmlns:rich namespace definition in the header
- In old jsf the first element had to be f:view. With facelets it is not necessary anymore.
- using rich:element to get the element in javascript

Of course this will work only if you use richfaces in your portlet not simple jsf.

Regards,
Balazs
ly tm, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 13 Data de Entrada: 13/12/10 Postagens Recentes
- Thanks Balazs Zsoldos!
- Code space var result = # {rich: element ('form')}. value error should not be used.
- I wishes to receive assistance.
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
- Code space var result = # {rich: element ('form')}. value error should not be used.

Is this an error message or an opinion or...? If it is an error message: are there spaces in your xhtml file as well in the expression? You sure you defined the rich namespace in the header of the xhtml file? Did you use sample-richfaces-portlet to start with?
ly tm, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 13 Data de Entrada: 13/12/10 Postagens Recentes
- Hi Balazs Zsoldos!
- I use the code you provided but still will not run.
- You can send me details about the code file is not?
- Thanks Balazs Zsoldos!
thumbnail
Srikanth Reddy Sanivarapu, modificado 12 Anos atrás.

RE: Working Richfaces portlet available

Regular Member Postagens: 203 Data de Entrada: 15/11/08 Postagens Recentes
Hi Balazs Zsoldos,

I have deployed the sample rich faces portlet in my Community edition 5.2.3. This portlet is working fine but throwing some Javascript errors at the bottom of the page. Those errors are::::

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.6; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; ShopperReports 3.0.491.0; SRS_IT_E8790574B1765B563EA096; MS-RTC LM 8)
Timestamp: Sat, 16 Jul 2011 10:36:52 UTC


Message: Object doesn't support this property or method
Line: 1
Char: 140014
Code: 0
URI: http://localhost:8080/html/js/everything.jsp?browserId=ie&themeId=classic&colorSchemeId=01&minifierType=js&minifierBundleId=javascript.everything.files&t=1242280472000


Message: Object doesn't support this property or method
Line: 1
Char: 171448
Code: 0
URI: http://localhost:8080/html/js/barebone.jsp?browserId=ie&themeId=classic&colorSchemeId=01&minifierType=js&minifierBundleId=javascript.barebone.files&t=1242280472000


Message: Object doesn't support this property or method
Line: 1
Char: 164973
Code: 0
URI: http://localhost:8080/html/js/barebone.jsp?browserId=ie&themeId=classic&colorSchemeId=01&minifierType=js&minifierBundleId=javascript.barebone.files&t=1242280472000



Can you please let me know how can I solve this errors. Waiting for your reply. Thanks.

Regards,
Srik
thumbnail
Balazs Zsoldos, modificado 12 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi,

the answer might be late.

This javascript error may come from the following reason: https://issues.jboss.org/browse/RF-9049
Chat portlet had a problem with this version of Richfaces, more exactly with the prototype version. You have append a couple of lines in one of the js files in the richfaces jar as it is said in the issue.
If not this the case I have no idea as we did not have other problem. I cannot remember if we met the problem of yours. We moved to Liferay 6.x (where there is no jquery and prototype javascript library) so we did not find error messages like these there.

Regards,
Balazs
jGofio code code, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 22 Data de Entrada: 03/11/09 Postagens Recentes
Hi Balazs,

first congratulation for your contribution to Liferay + RichFaces Community.

I have created an application based on your example portlet and all is ok BUT I have problem with tab panel component and modal dialogs...

I'm using Liferay 6.0.4, GlassFish 2.1.1 and these libraries:
[indent]portletbridge-api-2.0.1-SNAPSHOT.jar
portletbridge-impl-2.0.1.everit-SNAPSHOT.jar
richfaces-api-3.3.3.Final.jar
richfaces-impl-3.3.3.patched.jar
richfaces-ui-3.3.3.Final.jar
jsf-facelets-1.1.15.jar
jsf-api-1.2_14.jar
jsf-impl-1.2_14.jar[/indent]

The problems are:
  • Tab component works with switchType="server", but doesn't work using client or ajax switch type, if you click nothings happens...
  • Modal Dialogs give you a blank screen when they are shown.

I can avoid using modal dialog... but tabs are important for me...

Did you have find a solution for these issues??

If you don't have a solution but have tips about solving theses problems I can try and share with the community...

Thanks in advance!!

jGofio
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi,

for me it is really funny that we were suffering due to a very similar problem yesterday and today I got a message that others met the same issue.

We tried to open a modalpanel from within tabs. We found out the followings:

- The modalpanel appears but on the modalpanel nothing works.
- If we use ajax tab navigation after we change the tab at least ones everything works fine.
- If we use componentControl to hide the modalpanel we get a blank screen. This is because due to some reason compoenentcontrol sets a "display:none" on the body tag of the full html page.
- Similar problems when we use server side tab navigation with the difference that a tab change does not solve the problem (as the full page is re-rendered)

We have not tried it but if this problem does not occur when using a simple JSF application (without Liferay) then I guess the problem is related to incompatibility with one of javascript libraries that is brought by Liferay.

As we have a really close due date in the project we could not spend much time investigating the issue so we simply avoiding the use of modal panels and have simple page navigation and hope that this will not occur in the next release of richfaces.

However if you find a solution in the future I would be really happy if you could share emoticon.

Withing the next weeks we will not have time to investigate this problem.

Regards,
Balazs
jGofio code code, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 22 Data de Entrada: 03/11/09 Postagens Recentes
Hi Balazs,

I have found a way to show the modal dialogs... It's a workaround, I hope it will help you and the rest of the community...

The modal dialog fails (at least for me) if it was shown from h:outputLink. Using h:commandLink is working, here is an example:


  <h:commandlink id="lnkEdit" value="edit" immediate="true" onclick="return false;">
      <rich:componentcontrol for="mpEditH" event="onmouseup" operation="show" />                         
  </h:commandlink>  



HOWEVER, I still have problems with Tabs. My tabs are not in a modal dialog. The tabs work until you make an ajax call in the page, in example a4j:support, then when you click on the tab the panel doesn't change.

Any ideas?

Regards!
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi,

showing the modalpanel was not such a big problem for us but hiding it was not really possible emoticon
No ajax calls or any other call worked after a modalpanel was shown.

What took some time to find out before was that there cannot be h:form tag around modalpanel, and it might be true for the tabs as well. (For modalpanel it is in the manual but who reads the full manual always emoticon)

Regards,
Balazs
jGofio code code, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 22 Data de Entrada: 03/11/09 Postagens Recentes
Hi,

after some tests, the real problem is that all works ok until a reRender is done after an ajax request. Then certain components (tabs panel, a4j:queue) start
to fail (looks like the javascript related to the components doesn't work).

You can see this behaviour even in your example portlet (Sample Richfaces JSF 1.2 Sun Facelets 6.0.4.2). If you put a tabpanel at the end of the view.xhtml all goes fine until you write a name, then the reRender is executed and the tabs will fail (reload the page solve the problem till the next rerender).

Make a application without ajax and rerenders limit too much...

Have you avoid this problem or have any tips?

Thanks in advance for listen to me! ;)

regards.
jGofio
Marcel Jakobs, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 3 Data de Entrada: 10/11/10 Postagens Recentes
Hello,

I'm trying to deploy the sample plugin in JBoss AS 5.1.0 with Liferay 6.0.6 and I get the following error:

SEVERE [webapp] Initialization of the JSF runtime either failed or did not occurr.  Review the server''s log for details. 
java.lang.InstantiationException: org.jboss.portletbridge.context.FacesContextFactoryImpl
	at java.lang.Class.newInstance0(Class.java:340)
	at java.lang.Class.newInstance(Class.java:308)
	at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:537)
	at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:394)
	at javax.faces.FactoryFinder.access$400(FactoryFinder.java:135)
	at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:717)
	at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:239)
	at javax.faces.webapp.FacesServlet.init(FacesServlet.java:164)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4122)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4421)
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
	at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
	at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
	at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
	at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
	at $Proxy38.start(Unknown Source)

...

ERROR [2-facelets-portlet]] Servlet /richfaces-sun-jsf1.2-facelets-portlet threw load() exception
javax.servlet.UnavailableException: Initialization of the JSF runtime either failed or did not occurr.  Review the server''s log for details. 
	at javax.faces.webapp.FacesServlet.init(FacesServlet.java:172)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4122)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4421)
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
	at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
	at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
	at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
	at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
	at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
	at $Proxy38.start(Unknown Source)


Is there a way to get the sample (or a Portlet with JBoss PortletBridge, JSF and Richfaces) working on JBoss AS 5.1.0 and Liferay 6.0.6 (or liferay 6.0.5)?

Regards,
Marcel
thumbnail
Balazs Zsoldos, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

Junior Member Postagens: 41 Data de Entrada: 12/04/06 Postagens Recentes
Hi,

we tried the sample plugin on Glassfish and Tomcat. We do not have experience with JBoss AS however the problem might be similar to the classloader problem of Glassfish.

You can find a sun-web.xml in the war file. This contains additional configuration to Glassfish. There are two important things in it:
  • Use bundled JSF By default Glassfish uses the JSF implementation of the application server and does not care at all if the jsf jar files present in the war. It simply ignores them. As JSF is part of Java EE specification I can understand this behavior emoticon.
  • Classloader delegation: By default glassfish tries to find classes with the classloader of Glassfish first and than with the classloader of the web application. This may generate weird behavior. For example: Class A is loaded already from Glassfish classpath. Class B is loaded from the classpath of the webapp. Class B contains a code snippet where it uses reflection to instantiate class A but with the classloader of class B. In this case if there is a casting, there will be a ClassCastException...


I think if JBoss AS is similar to Glassfish both of these could cause the problem. The first case when not the bundled (jars in the war) JSF is used for initializing JSF but the classes from the war used later. In that case those classes might think that JSF is not initialized yet as their static fields are not set... The second case is the same due to the reason of classloader delegation.

So please try to find if JBoss AS has the possibility to add these options to the webapp somehow.

I hope this helps.

Regards,
Balazs
Marcel Jakobs, modificado 13 Anos atrás.

RE: Working Richfaces portlet available

New Member Postagens: 3 Data de Entrada: 10/11/10 Postagens Recentes
Hi Balazs,

thank you for your reply.

In your sample portlet there is a context parameter for using the bundled JSF implementation in JBoss AS but it seems not to work:
<context-param>
      <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
      <param-value>true</param-value>
</context-param>


I got it running by removing this context paramter from web.xml and deleting the JSF libraries from lib folder. So the buildin JSF implementation of JBoss AS is used.

Regards,
Marcel