留言板

JSF IPC using Public Parameters

Jatinderveer Singh,修改在7 年前。

JSF IPC using Public Parameters

New Member 帖子: 11 加入日期: 16-8-4 最近的帖子
I am using IPC in two JSF portlets to communicate one java class. I seem to be missing something and I am getting the following error ::
13:54:39,583 ERROR [IPCPhaseListener:301] null
  java.lang.IllegalStateException
 at com.liferay.portlet.StateAwareResponseImpl.setRenderParameter(StateAwareResponseImpl.java:173)
   at com.liferay.faces.bridge.event.IPCPhaseListener.processOutgoingPublicRenderParameters(IPCPhaseListener.java:279)
    at com.liferay.faces.bridge.event.IPCPhaseListener.afterPhase(IPCPhaseListener.java:83)
  at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:189)
   at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:107)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
  at com.liferay.faces.bridge.BridgePhaseActionImpl.execute(BridgePhaseActionImpl.java:81)
  at com.liferay.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:81)
  at javax.portlet.faces.GenericFacesPortlet.processAction(GenericFacesPortlet.java:152)



The changes i have done are the following ::
Portlet.xml ::

 <portlet>
       <portlet-name>Sender</portlet-name>
      <supported-public-render-parameter>communicationBean</supported-public-render-parameter>
   </portlet>
 <portlet-name>Reciever</portlet-name>
       <supported-public-render-parameter>communicationBean</supported-public-render-parameter>

 <public-render-parameter>
   <identifier>communicationBean</identifier>
   <qname xmlns:x="http://liferay.com/pub-render-params">x:communicationBean</qname>
</public-render-parameter>


Faces-config.xml :
 <application>
       <application-extension>
           <bridge:public-parameter-mappings>
           <bridge:public-parameter-mapping>
                <parameter>Sender:communicationBean</parameter>
               <model-el>#{senderManagedBean.communicationBean}</model-el>
            </bridge:public-parameter-mapping>
         <bridge:public-parameter-mapping>
                 <parameter>Reciever:communicationBean</parameter>
              <model-el>#{recieverManagedBean.communicationBean}</model-el>
            </bridge:public-parameter-mapping>
       </bridge:public-parameter-mappings>
 </application-extension>
</application>


The both managed beans are in View scope and the portlets are deployed on different pages with render-parameter-distributon set to layout-set.
Is there something that I am missing in this?
I saw this exactly from the demo given in website and it looks quite simple and should work? is there any more configuration required? or is it because i am passing a class that it is failing?
thumbnail
Neil Griffin,修改在7 年前。

RE: JSF IPC using Public Parameters

Liferay Legend 帖子: 2655 加入日期: 05-7-27 最近的帖子
Please let us know which version of Liferay Portal (and which server) you are using and also the versions of all of your dependencies that result in the WEB-INF/lib directory of your portlet .war file.

Also, please download the jsf-ipc-public-render-params demo war, deploy it in your environment, add both the "Customers" and "Bookings" portlets to a page, and let us know if it works. Thanks.
Jatinderveer Singh,修改在7 年前。

RE: JSF IPC using Public Parameters

New Member 帖子: 11 加入日期: 16-8-4 最近的帖子
Neil Griffin:
Please let us know which version of Liferay Portal (and which server) you are using and also the versions of all of your dependencies that result in the WEB-INF/lib directory of your portlet .war file.

Also, please download the jsf-ipc-public-render-params demo war, deploy it in your environment, add both the "Customers" and "Bookings" portlets to a page, and let us know if it works. Thanks.

I am working on Liferay 6.2 EE on tomcat. Is it possible for you to let me know if there is any particular dependency i should be looking for? My portlet are pretty straight forward nothing fancy just the regular auto avilable jars for a jsf standard portlet along with primefaces 5.2. It has been bugging me all day and i cant seem to have it working. Although the demo is very straight forward but somehow its not working in my case.

Is it necessary to implement the handler? i havent done it as i understand it is optional just for some extra computation.
Is it possible that the scope of managed bean is causing an issue as the portlets are on different pages and both the beans are in view scope?
thumbnail
Neil Griffin,修改在7 年前。

RE: JSF IPC using Public Parameters

Liferay Legend 帖子: 2655 加入日期: 05-7-27 最近的帖子
I set portlet.public.render.parameter.distribution=layout-set in portal-ext.properties and have modified the jsf-ipc-pub-render-parameters-portlet source in the following:
- Removed the handler
- Changed @RequestScoped to @ViewScoped

And I am unable to reproduce the problem. Regarding dependencies, please visit http://www.liferayfaces.org in order to determine the appropriate dependencies for your environment.
Jatinderveer Singh,修改在7 年前。

RE: JSF IPC using Public Parameters

New Member 帖子: 11 加入日期: 16-8-4 最近的帖子
Hi Neil,
I will upload the screenshot of war file lib folder sometime tomorrow. Please have a look and let me know incase i am missing something