Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Portlet Preferences are lost
Hi all
I'm using this environment:
It's happening a very very strain thing
I built some portlet pages where i added some instances of my own spring based portlets
All worked pretty good
After some time (several month) i saw that all my spring portlets in the most of the pages lost their preferences. I reconfigured all the portlets and 2 days later i saw that they lost their preferences once again
I checked liferay DB and i didn't find the portlets preferences in the DB.
How can i solve the issue? What should i check to fix and solve it?
Regards,
Angelo
I'm using this environment:
- Liferay 4.4.2
- Spring 2.0.6
- MySQL (and once also on Postgress)
It's happening a very very strain thing
I built some portlet pages where i added some instances of my own spring based portlets
All worked pretty good
After some time (several month) i saw that all my spring portlets in the most of the pages lost their preferences. I reconfigured all the portlets and 2 days later i saw that they lost their preferences once again
I checked liferay DB and i didn't find the portlets preferences in the DB.
How can i solve the issue? What should i check to fix and solve it?
Regards,
Angelo
Hi All,
Any update on this issue. Thanks.
Regards,
Srik
Any update on this issue. Thanks.
Regards,
Srik
Hi Srikanth
Just to know....are you having or did you have the same issue?
In affermative case.....may you tell me your environment?
Thank you.
Regards,
Angelo
Just to know....are you having or did you have the same issue?
In affermative case.....may you tell me your environment?
Thank you.
Regards,
Angelo
Hi Angelo,
I am using liferay tomcat 5.2.3 and sdk of the same version.
When i deploy the portlet onto my local server, the preferences are getting lost from there.
I am ending up with entering again the values there. Please let me know if you have any solution for this issue. Thanks.
Regards,
Srik
I am using liferay tomcat 5.2.3 and sdk of the same version.
When i deploy the portlet onto my local server, the preferences are getting lost from there.
I am ending up with entering again the values there. Please let me know if you have any solution for this issue. Thanks.
Regards,
Srik
Hi Srikanth
We are trying to investigate; if we solve we will advice you....if you solve before us...may you tell us too?
Thank you,
Angelo
We are trying to investigate; if we solve we will advice you....if you solve before us...may you tell us too?
Thank you,
Angelo
Sure Angelo....
Hi Srikanth
Sorry for being late but i was busy on other activities....
Anyway we did some debug and, at least on LF 4.4.2, we found in class com.liferay.portal.service.impl.PortletPreferencesLocalServiceImpl the following method
As you can see in the red block if something is wrong in recovering the portlet preferences the default preferencies are loaded, with no log message. We think this could be the problem. I don't know if this can be usefull for you too
We are going on in debuging
Regards,
Angelo
Sorry for being late but i was busy on other activities....
Anyway we did some debug and, at least on LF 4.4.2, we found in class com.liferay.portal.service.impl.PortletPreferencesLocalServiceImpl the following method
public javax.portlet.PortletPreferences getPreferences(
long companyId, long ownerId, int ownerType, long plid,
String portletId, String defaultPreferences)
throws PortalException, SystemException {
Map prefsPool = PortletPreferencesLocalUtil.getPreferencesPool(
ownerId, ownerType);
String key = encodeKey(plid, portletId);
PortletPreferencesImpl prefs =
(PortletPreferencesImpl)prefsPool.get(key);
if (prefs == null) {
PortletPreferences portletPreferences = null;
Portlet portlet = portletLocalService.getPortletById(
companyId, portletId);
try {
portletPreferences =
portletPreferencesPersistence.findByO_O_P_P(
ownerId, ownerType, plid, portletId);
}
catch (NoSuchPortletPreferencesException nsppe) {
System.out.println("NoSuchPortletPreferencesException");
nsppe.printStackTrace();
System.out.println("-------------------- fine stack ----------------------------------------");
[color=#FA1010]long portletPreferencesId = counterLocalService.increment();
portletPreferences = portletPreferencesPersistence.create(
portletPreferencesId);
portletPreferences.setOwnerId(ownerId);
portletPreferences.setOwnerType(ownerType);
portletPreferences.setPlid(plid);
portletPreferences.setPortletId(portletId);
if (Validator.isNull(defaultPreferences)) {
if (portlet == null) {
defaultPreferences = PortletImpl.DEFAULT_PREFERENCES;
}
else {
defaultPreferences = portlet.getDefaultPreferences();
}
}
portletPreferences.setPreferences(defaultPreferences);
portletPreferencesPersistence.update(portletPreferences);
}
prefs = PortletPreferencesSerializer.fromXML(
companyId, ownerId, ownerType, plid, portletId,
portletPreferences.getPreferences());
prefsPool.put(key, prefs);[/color]
}
return (PortletPreferencesImpl)prefs.clone();
}
As you can see in the red block if something is wrong in recovering the portlet preferences the default preferencies are loaded, with no log message. We think this could be the problem. I don't know if this can be usefull for you too
We are going on in debuging
Regards,
Angelo
Hi Angelo,
Thank you for providing the useful information.
If you get or find any solution or reason why these are getting lost, can you please let me too know. Thanks and waiting for you reply.
Regards,
Srik
Thank you for providing the useful information.
If you get or find any solution or reason why these are getting lost, can you please let me too know. Thanks and waiting for you reply.
Regards,
Srik
Any news?