voyent
Liferay Icefaces -User Session Expired AGAIN  XML
Forum Index -> Portals & Portlets Go to Page: Previous  1, 2, 3, 4 Next 
Author Message
deryk.sinotte


Joined: 26/Oct/2004 00:00:00
Messages: 1008
Offline


That's an interesting data point. What type of information are you trying to get at that requires setting?

Code:
<private-session-attributes>false</private-session-attributes>
 


I see from another forum post that some information appears to not be accessible unless you set this to false but it's not a requirement to do IPC with ICEfaces. For example, our [icefaces.dir]/samples/portlet/chat example does IPC without needing this configured.

Are there Liferay Portal specific settings that you are trying to retrieve?

Deryk Sinotte
Team Lead
ICEsoft Technologies, Inc.
dhaber

Joined: 22/Jul/2008 00:00:00
Messages: 14
Offline


Thanks again for the quick response.

I'm just trying to set a simple property (e.g. accountId) in portlet A (and WAR A) and then read that property in portlet B (and WAR B).

How does icefaces accomplish this across WARs?

Thanks some more!
Doug
deryk.sinotte


Joined: 26/Oct/2004 00:00:00
Messages: 1008
Offline


Actually there are a couple of different ways. If the portlets are all in the same war, then you can use an application scoped bean to share data. If you are storing stuff in the session, then you can use the PortletSession.APPLICATION_SCOPE parameter to get and set your attributes.

Deryk Sinotte
Team Lead
ICEsoft Technologies, Inc.
dhaber

Joined: 22/Jul/2008 00:00:00
Messages: 14
Offline


Unfortunately each portlet is in it's own WAR and liferay doesn't seem to want to share across WARs except if that param is on (but then icefaces is unhappy).

Any other options?

-Doug
dlucas8

Joined: 20/Mar/2008 00:00:00
Messages: 65
Offline


I think that you may have something dhaber. I am going to look into the private-session-attributes, because we are using it in our portlets so that we can share attributes from the portal to the portlets. I will work on creating a sample war and attach.

-Aaron
dlucas8

Joined: 20/Mar/2008 00:00:00
Messages: 65
Offline


Deryk and dhaber,

See below for more information on the liferay configuration parameter, private-session-attributes:

http://longgoldenears.blogspot.com/2008/03/liferay-session-sharing-demystified.html


In our case we are trying to share PORTAL specific attributes into a portlet.
http://www.icefaces.org/JForum/posts/list/9397.page So we are seeing both the user session expired issue and the problem with the sharing of attributes. Which may lead one to believe that they are somehow tied together?

-Aaron
dlucas8

Joined: 20/Mar/2008 00:00:00
Messages: 65
Offline


dhaber is correct

When I add the private-session-attributes into the liferay-portlet.xml file I immediately get the user session expired. Upon looking into the catalina.out log I see
Code:
 ug 12, 2008 5:20:50 PM com.icesoft.faces.application.D2DViewHandler <clinit>
 INFO: 
 ICEsoft Technologies, Inc.
 ICEfaces 1.7.1 
 Build number: 6
 Revision: 16923
 
 Aug 12, 2008 5:20:51 PM com.icesoft.faces.util.event.servlet.ContextEventRepeater contextInitialized
 INFO: Asynchronous HTTP Service available: false
 17:20:51,787 INFO  [PluginPackageHotDeployListener:74] Reading plugin package for CVRGTest2.5
 17:20:51,788 WARN  [PluginPackageHotDeployListener:123] Plugin package on context CVRGTest2.5 cannot be tracked because this WAR does not contain a liferay-plugin-package.xml file
 17:20:53,340 INFO  [PluginPackageHotDeployListener:187] Plugin package CVRGTest2.5/CVRGTest2.5/unknown/war registered successfully
 17:20:53,344 INFO  [PortletHotDeployListener:133] Registering portlets for CVRGTest2.5
 17:20:53,400 INFO  [PortletHotDeployListener:425] Portlets for CVRGTest2.5 registered successfully
 17:21:04,637 ERROR [jsp:52] com.icesoft.faces.webapp.http.core.SessionExpiredException: Session has been expired.
 	at com.icesoft.faces.webapp.http.core.SessionExpiredServer$2.respond(SessionExpiredServer.java:25)
 	at com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.respondWith(ServletRequestResponse.java:161)
 	at com.icesoft.faces.webapp.http.common.standard.ResponseHandlerServer.service(ResponseHandlerServer.java:15)
 	at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer$Matcher.serviceOnMatch(PathDispatcherServer.java:50)
 	at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:19)
 	at com.icesoft.faces.webapp.http.core.SessionExpiredServer.service(SessionExpiredServer.java:36)
 	at com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:16)
 	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:55)
 	at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
 	at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
 	at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:82)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
 	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
 	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
 	at com.liferay.portlet.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:245)
 	at com.liferay.portlet.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:87)
 	at com.icesoft.faces.webapp.http.portlet.MainPortlet.doInclude(MainPortlet.java:122)
 
 17:21:04,658 ERROR [InsertTag:922] ServletException in '/html/common/themes/portlet.jsp': File "/TestPortlet25.iface" not found
 javax.servlet.ServletException: File "/TestPortlet25.iface" not found
 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
 	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
 	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
 	at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
 	at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:609)
 	at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:99)
 	at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:135)
 	at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:760)
 	at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:892)
 	at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
 	at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1751)
 	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
 	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
 	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
 	at com.liferay.portal.util.PortalUtil.renderPortlet(PortalUtil.java:1873)
 	at com.liferay.portal.util.PortalUtil.renderPortlet(PortalUtil.java:1824)
 	at com.liferay.portal.action.RenderPortletAction.execute(RenderPortletAction.java:94)
 	at com.liferay.portal.action.UpdateLayoutAction.execute(UpdateLayoutAction.java:223)
 	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:158)
 	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:710)
 	at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:401)
 	at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:630)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 	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.doFilter(BaseFilter.java:98)
 	at com.liferay.filters.strip.StripFilter.doFilter(StripFilter.java:88)
 	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.doFilter(BaseFilter.java:98)
 	at com.liferay.filters.compression.CompressionFilter.doFilter(CompressionFilter.java:109)
 	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.doFilter(BaseFilter.java:98)
 	at com.liferay.filters.secure.SecureFilter.doFilter(SecureFilter.java:150)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 	at org.jasig.cas.client.web.filter.TicketValidationFilter.doFilterInternal(TicketValidationFilter.java:119)
 	at org.jasig.cas.client.web.filter.AbstractCasFilter.doFilter(AbstractCasFilter.java:100)
 	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:183)
 	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 	at org.jasig.cas.client.web.filter.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:97)
 	at org.jasig.cas.client.web.filter.AbstractCasFilter.doFilter(AbstractCasFilter.java:100)
 	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:183)
 	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
 	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.doFilter(BaseFilter.java:98)
 	at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.doFilter(VirtualHostFilter.java:173)
 	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.doFilter(BaseFilter.java:98)
 	at com.liferay.portal.servlet.filters.sessionid.SessionIdFilter.doFilter(SessionIdFilter.java:81)
 	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:175)
 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
 	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:286)
 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
 	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
 	at java.lang.Thread.run(Thread.java:595)
 



A place to look would be the private-request-attributes workaround that ice faces has implemented to inject request attributes that may be user defined, I have a feeling that this may be a similar problem but with the session.

Here is my backing bean, nothing complicated.
Code:
 package org.cvrgrid.portlets.test;
 
 import java.io.Serializable;
 import java.util.Enumeration;
 
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
 import javax.faces.event.ActionEvent;
 import javax.portlet.PortletSession;
 
 /**
  * Aug 7, 2008 8:40:16 AM
  * 
  * @author <A HREF="MAILTO:dlucas8@jhu.edu">David Aaron Lucas</A>
  *
  * 
  */
 public class CVRGTestPortletBean25 implements Serializable {
 
 	/**
 	 * 
 	 */
 	private static final long serialVersionUID = -3530444709271082016L;
 	private String theValue = "Click button to see portal session values!";
 
 	public String getTheValue() {
 		return theValue;
 	}
 
 	public void setTheValue(String theValue) {
 		this.theValue = theValue;
 	}
 	
 	public void submitBeanButtonListener(ActionEvent e) {
 		FacesContext facesContext = FacesContext.getCurrentInstance();
 		ExternalContext extContext = facesContext.getExternalContext();
 		PortletSession psession = (PortletSession)extContext.getSession(Boolean.FALSE);
 		Enumeration attributes =psession.getAttributeNames(PortletSession.PORTLET_SCOPE);
 		String temp ="";
 		for (; attributes.hasMoreElements();) {
             String name = (String) attributes.nextElement();
             Object value = (Object) psession.getAttribute(name);
             temp += "Key: " + name + " |Value: " + value.toString() + "|||";
 		}
 		theValue = temp;
 	}
 }
 


A war is also attached demonstrating this problem.
 Filename testPortlet25.war [Disk] Download
 Description
 Filesize 5773 Kbytes
 Downloaded:  126 time(s)

bschwam

Joined: 13/May/2008 00:00:00
Messages: 3
Offline


Deryk,

I have been working with DLucas8 here at JHU. I built a new app from ground up and kept the functional increases small. I didn't get session expired issues until I added back in the tag:

<private-session-attributes>false</private-session-attributes>

As soon as that was in, the error popped up right after hot deploying.

This is critical for us since we can't get different portlets to use the same session level bean. We have 3 portlets (same war) and 4 backing beans. 1 of the backing beans is used across all 3 portlets - any thoughts?
bschwam

Joined: 13/May/2008 00:00:00
Messages: 3
Offline


Deryk - our fix also made use of the code change for elementController that you indicated earlier.
deryk.sinotte


Joined: 26/Oct/2004 00:00:00
Messages: 1008
Offline


We're currently still investigating the problem with <private-session-attributes>false</private-session-attributes> but I don't have a workaround or any additional information at the moment.

You say that your portlets are in the same .war now but you can't get them to use the same session bean? This should work fine. What is the code you are using to get/set values in the shared bean?

Deryk Sinotte
Team Lead
ICEsoft Technologies, Inc.
bschwam

Joined: 13/May/2008 00:00:00
Messages: 3
Offline


Deryk: here is the function where we pull it out of session:

Code:
 protected EcgDataStoreBean getEcgDataStoreBean() {
 		PortletRequest request = (PortletRequest) FacesContext
 				.getCurrentInstance().getExternalContext().getRequest();
 		log.error("I got Portlet Request: \n");
 		EcgDataStoreBean edsb = (EcgDataStoreBean) (request
 				.getPortletSession(Boolean.FALSE).getAttribute("ecgDataStoreBean", PortletSession.APPLICATION_SCOPE));
 				//.getAttribute("ecgDataStoreBean"));
 		log.error("Value:" + edsb.getName());
 		return edsb;
 		
 	}
 
dlucas8

Joined: 20/Mar/2008 00:00:00
Messages: 65
Offline


I have created a simple war that will demonstrate, our problem. Even without setting the shared-session-attributes parameter in teh liferay-portlet.xml we are getting a null pointer exception as Bryan described earlier.

 Filename backingBeanTestWithLiferaySetting.war [Disk] Download
 Description War with the private-session-attributes setting to false
 Filesize 5775 Kbytes
 Downloaded:  143 time(s)

 Filename backingBeanTestWOLiferaySetting.war [Disk] Download
 Description War that doesn't contain the setting (commented out)
 Filesize 5775 Kbytes
 Downloaded:  154 time(s)

dlucas8

Joined: 20/Mar/2008 00:00:00
Messages: 65
Offline


Here is my elclipse project with source code.
 Filename backingBeanTest.zip [Disk] Download
 Description
 Filesize 256 Kbytes
 Downloaded:  217 time(s)

deryk.sinotte


Joined: 26/Oct/2004 00:00:00
Messages: 1008
Offline


I'm a bit confused by the example code that shows the NPE. In BackingBean2 you are relying on pulling out BackingBean1 based on the attribute name "ecgDataStoreBean" but that's never put into the session by your code. What mechanism are you relying on to have this bean in the session with that key? Is there some other piece missing (e.g. Spring injection)?

If I add some code to BackingBean1 that adds a reference into the session with APPLICATION_SCOPE, the example works fine.

Code:
PortletRequest request = (PortletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
 PortletSession sess = request.getPortletSession(Boolean.FALSE);
 sess.setAttribute("backingBean1", this, PortletSession.APPLICATION_SCOPE);
 

Deryk Sinotte
Team Lead
ICEsoft Technologies, Inc.
dlucas8

Joined: 20/Mar/2008 00:00:00
Messages: 65
Offline


Forgive my ignorance.

But why wouldn't this work.
Code:
 	protected static BackingBean1 getBackingBean1() {
 		return (BackingBean1) FacesContext.getCurrentInstance()
 				.getExternalContext().getSessionMap().get("backingBean1");
 
 	}
 


The bean is being set as a session bean in the faces-config file and values are being added to it from the first portlet. Why should I have to add it to the session by using .setAttribute(). Shouldn't it already be there?
 
Forum Index -> Portals & Portlets Go to Page: Previous  1, 2, 3, 4 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team