tags:

views:

19

answers:

1

I am using def liferay_portlet_private_session_attributes = false in grails portlet for liferay . This i was using to share session values with other portlet .

session.getAttribute("orgid", PortletSession.APPLICATION_SCOPE) 

I was getting this error when build,deployed each time refresh the url.

Caused by: java.lang.ClassCastException: org.codehaus.groovy.grails.web.servlet.GrailsFlashScope cannot be cast to org.codehaus.groovy.grails.web.servlet.FlashScope

If i logout and login it works good . But i am unable to understand how to fix it keeping the same settings.

Could any one please tell me is there any fix .

+1  A: 

As discussed via email, I think this is a ClassLoader issue. An object of type GrailsFlashScope (loaded in one portlet) is trying to be cast to FlashScope (loaded in the second portlet).

Even though GrailsFlashScope implements FlashScope, the FlashScope class loaded from two different class loaders are not considered equal and will throw CCE's.

The only way I can think to fix it is to move the grails-*.jar files (e.g. grails-web.jar) to some kind of shared jar folder (not sure where that is in Liferay) and remove them from the portlet WAR files.

cheers

Lee

leebutts