WLP Sessions and Porlets in Shared Libraries

Awhile back, I ran into an issue where session data was being lost between requests in a WebLogic Portal project. As it only occurred in a clustered environment, it was obvious that the value was not being persisted, even though persistence was set properly with

<wls:session-descriptor>
<wls:persistent-store-type>replicated_if_clustered</wls:persistent-store-type>
</wls:session-descriptor>

After much frustration, someone on the team ran across an additional setting for the session-descriptor node: sharing-enabled. In the case where a portlet is from a shared library, the persistence does not work unless sharing-enabled is set to true.

<wls:session-descriptor>
<wls:persistent-store-type>replicated_if_clustered</wls:persistent-store-type>
<wls:sharing-enabled>true</wls:sharing-enabled>
</wls:session-descriptor>

In hindsight, this behavior makes some sense, in that most portlets that are distributed as shared libraries by vendors do not require session values. However, in the case where a shared library is created by an application team to reuse portlets across portals where WSRP is not practical, the need to share sessions may arise, and now you know how to fix it.

For other deployment descriptor options, see http://download.oracle.com/docs/cd/E12840_01/wls/docs103/webapp/weblogic_xml.html

Facebooktwitterredditlinkedinmail
© Scott S. Nelson

Good Article on WebLogic Deployment Plans

In WLS, deployment plans let you change the values in deployment descriptors at deployment time. This is really handy when you want to move your deployment archives from one environment to the next (i.e., from Staging to Production) and need different settings based on the environment. Maxence Button blogged an excellent how-to at http://m-button.blogspot.com/2008/08/how-to-use-deployment-plan.html

Facebooktwitterredditlinkedinmail
© Scott S. Nelson